Table of Contents

Class Utilities

Namespace
DisCatSharp
Assembly
DisCatSharp.dll

Various Discord-related utilities.

public static class Utilities
Inheritance
Utilities
Inherited Members

Methods

AddParameter(Uri, string, string)

Adds the specified parameter to the Query String.

CheckGitHubVersionAsync(DiscordClient, string, string, string, bool, string?, string?)

Perfoms a version check against github releases.

CheckNuGetVersionAsync(DiscordClient, string, bool, string?)

Performs a version check against nuget.

Contains(string, params char[])

Checks whether this string contains given characters.

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.

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.

StripIds(string?, bool)

Removes discord-based ids from a given string.

StripTokens(string?)

Removes discord-based tokens from a given string.

StripTokensAndOptIds(string?, bool)

Shorthand method to strip both tokens and IDs.

ToPermissionString(Permissions, bool, bool, bool, bool)

Converts this Permissions into human-readable format.