Class BaseDiscordClient
- Namespace
- DisCatSharp
- Assembly
- DisCatSharp.dll
Represents a common base for various Discord Client implementations.
public abstract class BaseDiscordClient : IDisposable, IAsyncDisposable
- Inheritance
-
BaseDiscordClient
- Implements
- Derived
- Inherited Members
Constructors
- BaseDiscordClient(DiscordConfiguration)
Initializes this Discord API client.
Properties
- ApiChannel
Gets the current api channel.
- ApiClient
Gets the api client.
- ApiVersion
Gets the current api version.
- BotLibrary
Gets the bot library name.
- Configuration
Gets the configuration.
- CurrentApplication
Gets the current application.
- CurrentUser
Gets the current user.
- Emojis
Gets the cached application emojis for this client.
- Guilds
Gets the cached guilds for this client.
- InternalVoiceRegions
Gets the list of available voice regions. This property is meant as a way to modify VoiceRegions.
- Logger
Gets the instance of the logger for this client.
- RestClient
Exposes a Http Client for custom operations.
- RestDiagnostics
Gets the REST diagnostics provider, exposing runtime metrics for bucket workers, queue depths, and circuit breaker state. Returns a safe wrapper — the underlying RestClient cannot be accessed through this property.
- Statistics
Gets the statistics for this client.
- UserCache
Gets the cached users for this client.
- VersionString
Gets the string representing the version of bot lib.
- VoiceRegions
Gets the list of available voice regions. Note that this property will not contain VIP voice regions.
Methods
- CancelAllPendingRequests(string?)
Cancels all pending REST requests across every bucket worker queue. Each cancelled request is faulted with OperationCanceledException. Use this as an emergency stop when stuck queues or cascading failures need immediate clearing.
- Dispose()
Disposes this client.
- DisposeAsync()
Asynchronously disposes this client.
- EnableUserAppsAsync()
Enables user app functionality.
- GetCurrentApplicationAsync(CancellationToken)
Gets the current API application.
- GetGatewayInfoAsync(string?, CancellationToken)
Gets the current gateway info for the provided token.
If no value is provided, the configuration value will be used instead.
- InitializeAsync(CancellationToken)
Initializes this client. This method fetches information about current user, application, and voice regions.
- ListVoiceRegionsAsync(CancellationToken)
Gets a list of voice regions.
- UpdateCurrentApplicationInfoAsync(Optional<string?>, Optional<string?>, Optional<string?>, Optional<string?>, Optional<List<string>?>, Optional<Stream?>, Optional<Stream?>, Optional<ApplicationFlags>, Optional<DiscordApplicationInstallParams?>, CancellationToken)
Updates the current API application.
- UpdateCurrentApplicationInfoAsync(Optional<string?>, Optional<string?>, Optional<string?>, Optional<string?>, Optional<List<string>?>, Optional<Stream?>, Optional<Stream?>, Optional<ApplicationFlags>, Optional<DiscordIntegrationTypesConfig?>, CancellationToken)
Updates the current API application.