Class BaseDiscordClient
Represents a common base for various Discord client implementations.
Inheritance
Namespace: DSharpPlus
Assembly: cs.temp.dll.dll
Syntax
public abstract class BaseDiscordClient : IDisposable
Constructors
BaseDiscordClient(DiscordConfiguration)
Initializes this Discord API client.
Declaration
protected BaseDiscordClient(DiscordConfiguration config)
Parameters
Type | Name | Description |
---|---|---|
DiscordConfiguration | config | Configuration for this client. |
Properties
ApiClient
Declaration
protected DiscordApiClient ApiClient { get; }
Property Value
Type | Description |
---|---|
DiscordApiClient |
Configuration
Declaration
protected DiscordConfiguration Configuration { get; }
Property Value
Type | Description |
---|---|
DiscordConfiguration |
CurrentApplication
Gets the current application.
Declaration
public DiscordApplication CurrentApplication { get; }
Property Value
Type | Description |
---|---|
DiscordApplication |
CurrentUser
Gets the current user.
Declaration
public DiscordUser CurrentUser { get; }
Property Value
Type | Description |
---|---|
DiscordUser |
Guilds
Gets the cached guilds for this client.
Declaration
public abstract IReadOnlyDictionary<ulong, DiscordGuild> Guilds { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<System.UInt64, DiscordGuild> |
InternalVoiceRegions
Gets the list of available voice regions. This property is meant as a way to modify VoiceRegions.
Declaration
protected ConcurrentDictionary<string, DiscordVoiceRegion> InternalVoiceRegions { get; set; }
Property Value
Type | Description |
---|---|
ConcurrentDictionary<System.String, DiscordVoiceRegion> |
Logger
Gets the instance of the logger for this client.
Declaration
public ILogger<BaseDiscordClient> Logger { get; }
Property Value
Type | Description |
---|---|
ILogger<BaseDiscordClient> |
UserCache
Gets the cached users for this client.
Declaration
protected ConcurrentDictionary<ulong, DiscordUser> UserCache { get; }
Property Value
Type | Description |
---|---|
ConcurrentDictionary<System.UInt64, DiscordUser> |
VersionString
Gets the string representing the version of D#+.
Declaration
public string VersionString { get; }
Property Value
Type | Description |
---|---|
System.String |
VoiceRegions
Gets the list of available voice regions. Note that this property will not contain VIP voice regions.
Declaration
public IReadOnlyDictionary<string, DiscordVoiceRegion> VoiceRegions { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<System.String, DiscordVoiceRegion> |
Methods
Dispose()
Disposes this client.
Declaration
public abstract void Dispose()
GetCurrentApplicationAsync()
Gets the current API application.
Declaration
public Task<DiscordApplication> GetCurrentApplicationAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordApplication> | Current API application. |
GetGatewayInfoAsync(String)
Gets the current gateway info for the provided token.
If no value is provided, the configuration value will be used instead.
Declaration
public Task<GatewayInfo> GetGatewayInfoAsync(string token = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<GatewayInfo> | A gateway info object. |
InitializeAsync()
Initializes this client. This method fetches information about current user, application, and voice regions.
Declaration
public virtual Task InitializeAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ListVoiceRegionsAsync()
Gets a list of regions
Declaration
public Task<IReadOnlyList<DiscordVoiceRegion>> ListVoiceRegionsAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordVoiceRegion>> |
Exceptions
Type | Condition |
---|---|
ServerErrorException | Thrown when Discord is unable to process the request. |