Class Utilities
- Namespace
- DSharpPlus
- Assembly
- DSharpPlus.dll
Various Discord-related utilities.
public static class Utilities
- Inheritance
-
objectUtilities
Methods
- Contains(string, params char[])
Checks whether this string contains given characters.
- CreateSnowflake(DateTimeOffset)
Creates a snowflake from a given System.DateTimeOffset. This can be used to provide "timestamps" for methods like GetMessagesAfterAsync(ulong, int, CancellationToken).
- GetDateTimeOffset(long, bool)
Helper method to create a System.DateTimeOffset from Unix time seconds for targets that do not support this natively.
- GetDateTimeOffsetFromMilliseconds(long, bool)
Helper method to create a System.DateTimeOffset from Unix time milliseconds for targets that do not support this natively.
- GetShardId(ulong, int)
Gets a shard id from a guild id and total shard count.
- GetSnowflakeTime(ulong)
Computes a timestamp from a given snowflake.
- GetUnixTime(DateTimeOffset)
Helper method to calculate Unix time seconds from a System.DateTimeOffset for targets that do not support this natively.