Show / Hide Table of Contents

# Class BaseDiscordClient

##### Inheritance

System.Object
BaseDiscordClient
DiscordRestClient
BaseSocketClient

##### Implements

IDiscordClient
System.IDisposable

##### Inherited Members

System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()

###### Namespace: Discord.Rest

###### Assembly: Discord.Net.Rest.dll

##### Syntax

    public abstract class BaseDiscordClient : IDiscordClient, IDisposable

### Properties

| Improve this Doc View Source

#### CurrentUser

Gets the logged-in user.

##### Declaration

    public ISelfUser CurrentUser { get; protected set; }

##### Property Value

Type | Description
--- | ---
ISelfUser |

| Improve this Doc View Source

#### LoginState

Gets the login state of the client.

##### Declaration

    public LoginState LoginState { get; }

##### Property Value

Type | Description
--- | ---
LoginState |

| Improve this Doc View Source

#### TokenType

##### Declaration

    public TokenType TokenType { get; }

##### Property Value

Type | Description
--- | ---
TokenType |

### Methods

| Improve this Doc View Source

#### Dispose()

##### Declaration

    public void Dispose()

| Improve this Doc View Source

#### GetRecommendedShardCountAsync(RequestOptions)

##### Declaration

    public Task<int> GetRecommendedShardCountAsync(RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Int32> |

| Improve this Doc View Source

#### LoginAsync(TokenType, String, Boolean)

##### Declaration

    public Task LoginAsync(TokenType tokenType, string token, bool validateToken = true)

##### Parameters

Type | Name | Description
--- | --- | ---
TokenType | tokenType |
System.String | token |
System.Boolean | validateToken |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

| Improve this Doc View Source

#### LogoutAsync()

##### Declaration

    public Task LogoutAsync()

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

### Events

| Improve this Doc View Source

#### Log

##### Declaration

    public event Func<LogMessage, Task> Log

##### Event Type

Type | Description
--- | ---
System.Func<LogMessage, System.Threading.Tasks.Task> |

| Improve this Doc View Source

#### LoggedIn

##### Declaration

    public event Func<Task> LoggedIn

##### Event Type

Type | Description
--- | ---
System.Func<System.Threading.Tasks.Task> |

| Improve this Doc View Source

#### LoggedOut

##### Declaration

    public event Func<Task> LoggedOut

##### Event Type

Type | Description
--- | ---
System.Func<System.Threading.Tasks.Task> |

### Explicit Interface Implementations

| Improve this Doc View Source

#### IDiscordClient.ConnectionState

##### Declaration

    ConnectionState IDiscordClient.ConnectionState { get; }

##### Returns

Type | Description
--- | ---
ConnectionState |

| Improve this Doc View Source

#### IDiscordClient.CreateGuildAsync(String, IVoiceRegion, Stream, RequestOptions)

##### Declaration

    Task<IGuild> IDiscordClient.CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |
IVoiceRegion | region |
System.IO.Stream | jpegIcon |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IGuild> |

##### Exceptions

Type | Condition
--- | ---
System.NotSupportedException | Creating a guild is not supported with the base client.

| Improve this Doc View Source

#### IDiscordClient.CurrentUser

##### Declaration

    ISelfUser IDiscordClient.CurrentUser { get; }

##### Returns

Type | Description
--- | ---
ISelfUser |

| Improve this Doc View Source

#### IDiscordClient.GetApplicationInfoAsync(RequestOptions)

##### Declaration

    Task<IApplication> IDiscordClient.GetApplicationInfoAsync(RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IApplication> |

| Improve this Doc View Source

#### IDiscordClient.GetChannelAsync(UInt64, CacheMode, RequestOptions)

##### Declaration

    Task<IChannel> IDiscordClient.GetChannelAsync(ulong id, CacheMode mode, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.UInt64 | id |
CacheMode | mode |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IChannel> |

| Improve this Doc View Source

#### IDiscordClient.GetConnectionsAsync(RequestOptions)

##### Declaration

    Task<IReadOnlyCollection<IConnection>> IDiscordClient.GetConnectionsAsync(RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IConnection>> |

| Improve this Doc View Source

#### IDiscordClient.GetDMChannelsAsync(CacheMode, RequestOptions)

##### Declaration

    Task<IReadOnlyCollection<IDMChannel>> IDiscordClient.GetDMChannelsAsync(CacheMode mode, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
CacheMode | mode |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IDMChannel>> |

| Improve this Doc View Source

#### IDiscordClient.GetGroupChannelsAsync(CacheMode, RequestOptions)

##### Declaration

    Task<IReadOnlyCollection<IGroupChannel>> IDiscordClient.GetGroupChannelsAsync(CacheMode mode, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
CacheMode | mode |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGroupChannel>> |

| Improve this Doc View Source

#### IDiscordClient.GetGuildAsync(UInt64, CacheMode, RequestOptions)

##### Declaration

    Task<IGuild> IDiscordClient.GetGuildAsync(ulong id, CacheMode mode, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.UInt64 | id |
CacheMode | mode |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IGuild> |

| Improve this Doc View Source

#### IDiscordClient.GetGuildsAsync(CacheMode, RequestOptions)

##### Declaration

    Task<IReadOnlyCollection<IGuild>> IDiscordClient.GetGuildsAsync(CacheMode mode, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
CacheMode | mode |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuild>> |

| Improve this Doc View Source

#### IDiscordClient.GetInviteAsync(String, RequestOptions)

##### Declaration

    Task<IInvite> IDiscordClient.GetInviteAsync(string inviteId, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | inviteId |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IInvite> |

| Improve this Doc View Source

#### IDiscordClient.GetPrivateChannelsAsync(CacheMode, RequestOptions)

##### Declaration

    Task<IReadOnlyCollection<IPrivateChannel>> IDiscordClient.GetPrivateChannelsAsync(CacheMode mode, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
CacheMode | mode |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IPrivateChannel>> |

| Improve this Doc View Source

#### IDiscordClient.GetUserAsync(String, String, RequestOptions)

##### Declaration

    Task<IUser> IDiscordClient.GetUserAsync(string username, string discriminator, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | username |
System.String | discriminator |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IUser> |

| Improve this Doc View Source

#### IDiscordClient.GetUserAsync(UInt64, CacheMode, RequestOptions)

##### Declaration

    Task<IUser> IDiscordClient.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.UInt64 | id |
CacheMode | mode |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IUser> |

| Improve this Doc View Source

#### IDiscordClient.GetVoiceRegionAsync(String, RequestOptions)

##### Declaration

    Task<IVoiceRegion> IDiscordClient.GetVoiceRegionAsync(string id, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | id |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IVoiceRegion> |

| Improve this Doc View Source

#### IDiscordClient.GetVoiceRegionsAsync(RequestOptions)

##### Declaration

    Task<IReadOnlyCollection<IVoiceRegion>> IDiscordClient.GetVoiceRegionsAsync(RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IVoiceRegion>> |

| Improve this Doc View Source

#### IDiscordClient.GetWebhookAsync(UInt64, RequestOptions)

##### Declaration

    Task<IWebhook> IDiscordClient.GetWebhookAsync(ulong id, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.UInt64 | id |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IWebhook> |

| Improve this Doc View Source

#### IDiscordClient.StartAsync()

##### Declaration

    Task IDiscordClient.StartAsync()

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

| Improve this Doc View Source

#### IDiscordClient.StopAsync()

##### Declaration

    Task IDiscordClient.StopAsync()

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

### Implements

IDiscordClient
System.IDisposable

### Extension Methods

ClientExtensions.AddGuildUserAsync(BaseDiscordClient, UInt64, UInt64, String, Action<AddGuildUserProperties>, RequestOptions)