Class Utilities
- Namespace
- DSharpPlus
- Assembly
- DSharpPlus.dll
Various Discord-related utilities.
public static class Utilities
- Inheritance
-
Utilities
Methods
- Contains(string, params char[])
Checks whether this string contains given characters.
- CreateSnowflake(DateTimeOffset)
Creates a snowflake from a given DateTimeOffset. This can be used to provide "timestamps" for methods like GetMessagesAfterAsync(ulong, int, CancellationToken).
- GetDateTimeOffset(long, bool)
Helper method to create a DateTimeOffset from Unix time seconds for targets that do not support this natively.
- GetDateTimeOffsetFromMilliseconds(long, bool)
Helper method to create a 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 DateTimeOffset for targets that do not support this natively.
- ToPermissionString(DiscordPermissions)
Converts this DiscordPermissions into human-readable format.