Class BaseSocketClient
Represents the base of a WebSocket-based Discord client.
Assembly: Discord.Net.WebSocket.dll​
View Source​
public abstract class BaseSocketClient : BaseDiscordClient, IDiscordClient, IDisposable
Properties​
Latency​
Gets the estimated round-trip latency, in milliseconds, to the gateway server.
View Source​
public abstract int Latency { get; protected set; }
Status​
Gets the status for the logged-in user.
View Source​
public abstract UserStatus Status { get; protected set; }
Activity​
Gets the activity for the logged-in user.
View Source​
public abstract IActivity Activity { get; protected set; }
Rest​
Provides access to a REST-only client with a shared state from this client.
View Source​
public abstract DiscordSocketRestClient Rest { get; }
DefaultStickerPacks​
Gets a collection of default stickers.
View Source​
public abstract IReadOnlyCollection<StickerPack<SocketSticker>> DefaultStickerPacks { get; }
CurrentUser​
Gets the current logged-in user.
View Source​
public virtual SocketSelfUser CurrentUser { get; protected set; }
Guilds​
Gets a collection of guilds that the user is currently in.
View Source​
public abstract IReadOnlyCollection<SocketGuild> Guilds { get; }
PrivateChannels​
Gets a collection of private channels opened in this session.
View Source​
public abstract IReadOnlyCollection<ISocketPrivateChannel> PrivateChannels { get; }
Fields​
BaseConfig​
View Source​
protected readonly DiscordSocketConfig BaseConfig
Methods​
GetApplicationInfoAsync(RequestOptions)​
Gets a Discord application information for the logged-in user.
View Source​
public abstract Task<RestApplication> GetApplicationInfoAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestApplication>
:
A task that represents the asynchronous get operation. The task result contains the application
information.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetUser(UInt64)​
Gets a generic user.
View Source​
public abstract SocketUser GetUser(ulong id)
Returns​
Discord.WebSocket.SocketUser:
A generic WebSocket-based user; null
when the user cannot be found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user snowflake ID. |
GetUser(String, String)​
Gets a user.
View Source​
public abstract SocketUser GetUser(string username, string discriminator)
Returns​
Discord.WebSocket.SocketUser:
A generic WebSocket-based user; null
when the user cannot be found.
Parameters​
Type | Name | Description |
---|---|---|
System.String | username | The name of the user. |
System.String | discriminator | The discriminator value of the user. |
GetChannel(UInt64)​
Gets a channel.
View Source​
public abstract SocketChannel GetChannel(ulong id)
Returns​
Discord.WebSocket.SocketChannel:
A generic WebSocket-based channel object (voice, text, category, etc.) associated with the identifier;
null
when the channel cannot be found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the channel (e.g. 381889909113225237 ). |
GetGuild(UInt64)​
Gets a guild.
View Source​
public abstract SocketGuild GetGuild(ulong id)
Returns​
Discord.WebSocket.SocketGuild:
A WebSocket-based guild associated with the snowflake identifier; null
when the guild cannot be
found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The guild snowflake identifier. |
GetVoiceRegionsAsync(RequestOptions)​
Gets all voice regions.
View Source​
public abstract ValueTask<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.ValueTask<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestVoiceRegion>>
:
A task that contains a read-only collection of REST-based voice regions.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetVoiceRegionAsync(String, RequestOptions)​
Gets a voice region.
View Source​
public abstract ValueTask<RestVoiceRegion> GetVoiceRegionAsync(string id, RequestOptions options = null)
Returns​
System.Threading.Tasks.ValueTask<Discord.Rest.RestVoiceRegion>
:
A task that contains a REST-based voice region associated with the identifier; null
if the
voice region is not found.
Parameters​
Type | Name | Description |
---|---|---|
System.String | id | The identifier of the voice region (e.g. eu-central ). |
Discord.RequestOptions | options | The options to be used when sending the request. |
StartAsync()​
Starts the connection between Discord and the client..
View Source​
public abstract Task StartAsync()
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous start operation.
StopAsync()​
Stops the connection between Discord and the client.
View Source​
public abstract Task StopAsync()
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous stop operation.
SetStatusAsync(UserStatus)​
Sets the current status of the user (e.g. Online, Do not Disturb).
View Source​
public abstract Task SetStatusAsync(UserStatus status)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous set operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.UserStatus | status | The new status to be set. |
SetGameAsync(String, String, ActivityType)​
Sets the game of the user.
View Source​
public abstract Task SetGameAsync(string name, string streamUrl = null, ActivityType type = ActivityType.Playing)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous set operation.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the game. |
System.String | streamUrl | If streaming, the URL of the stream. Must be a valid Twitch URL. |
Discord.ActivityType | type | The type of the game. |
SetActivityAsync(IActivity)​
Sets the <code data-dev-comment-type="paramref" class="paramref">activity</code> of the logged-in user.
View Source​
public abstract Task SetActivityAsync(IActivity activity)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous set operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IActivity | activity | The activity to be set. |
DownloadUsersAsync(IEnumerable<IGuild>)​
Attempts to download users into the user cache for the selected guilds.
View Source​
public abstract Task DownloadUsersAsync(IEnumerable<IGuild> guilds)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous download operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Discord.IGuild> | guilds | The guilds to download the members from. |
CreateGuildAsync(String, IVoiceRegion, Stream, RequestOptions)​
Creates a guild for the logged-in user who is in less than 10 active guilds.
View Source​
public Task<RestGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuild>
:
A task that represents the asynchronous creation operation. The task result contains the created guild.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the new guild. |
Discord.IVoiceRegion | region | The voice region to create the guild with. |
System.IO.Stream | jpegIcon | The icon of the guild. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetConnectionsAsync(RequestOptions)​
Gets the connections that the user has set up.
View Source​
public Task<IReadOnlyCollection<RestConnection>> GetConnectionsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestConnection>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of connections.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetInviteAsync(String, RequestOptions)​
Gets an invite.
View Source​
public Task<RestInviteMetadata> GetInviteAsync(string inviteId, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestInviteMetadata>
:
A task that represents the asynchronous get operation. The task result contains the invite information.
Parameters​
Type | Name | Description |
---|---|---|
System.String | inviteId | The invitation identifier. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetStickerAsync(UInt64, CacheMode, RequestOptions)​
Gets a sticker.
View Source​
public abstract Task<SocketSticker> GetStickerAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.WebSocket.SocketSticker>
:
A Discord.WebSocket.SocketSticker if found, otherwise null
.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The id of the sticker to get. |
Discord.CacheMode | mode | Whether or not to allow downloading from the api. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetApplicationInfoAsync(RequestOptions)​
Gets a Discord application information for the logged-in user.
View Source​
async Task<IApplication> IDiscordClient.GetApplicationInfoAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IApplication>
:
A task that represents the asynchronous get operation. The task result contains the application
information.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetChannelAsync(UInt64, CacheMode, RequestOptions)​
Gets a generic channel.
View Source​
Task<IChannel> IDiscordClient.GetChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IChannel>
:
A task that represents the asynchronous get operation. The task result contains the channel associated
with the snowflake identifier; null
when the channel cannot be found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the channel (e.g. 381889909113225237 ). |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetPrivateChannelsAsync(CacheMode, RequestOptions)​
Gets a collection of private channels opened in this session.
View Source​
Task<IReadOnlyCollection<IPrivateChannel>> IDiscordClient.GetPrivateChannelsAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IPrivateChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
of private channels that the user currently partakes in.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetConnectionsAsync(RequestOptions)​
Gets the connections that the user has set up.
View Source​
async Task<IReadOnlyCollection<IConnection>> IDiscordClient.GetConnectionsAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IConnection>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of connections.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetInviteAsync(String, RequestOptions)​
Gets an invite.
View Source​
async Task<IInvite> IDiscordClient.GetInviteAsync(string inviteId, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IInvite>
:
A task that represents the asynchronous get operation. The task result contains the invite information.
Parameters​
Type | Name | Description |
---|---|---|
System.String | inviteId | The invitation identifier. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetGuildAsync(UInt64, CacheMode, RequestOptions)​
Gets a guild.
View Source​
Task<IGuild> IDiscordClient.GetGuildAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuild>
:
A task that represents the asynchronous get operation. The task result contains the guild associated
with the snowflake identifier; null
when the guild cannot be found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The guild snowflake identifier. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetGuildsAsync(CacheMode, RequestOptions)​
Gets a collection of guilds that the user is currently in.
View Source​
Task<IReadOnlyCollection<IGuild>> IDiscordClient.GetGuildsAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuild>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
of guilds that the current user is in.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.CreateGuildAsync(String, IVoiceRegion, Stream, RequestOptions)​
Creates a guild for the logged-in user who is in less than 10 active guilds.
View Source​
async Task<IGuild> IDiscordClient.CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuild>
:
A task that represents the asynchronous creation operation. The task result contains the created guild.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the new guild. |
Discord.IVoiceRegion | region | The voice region to create the guild with. |
System.IO.Stream | jpegIcon | The icon of the guild. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetUserAsync(UInt64, CacheMode, RequestOptions)​
Gets a user.
View Source​
Task<IUser> IDiscordClient.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IUser>
:
A task that represents the asynchronous get operation. The task result contains the user associated with
the snowflake identifier; null
if the user is not found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the user (e.g. 168693960628371456 ). |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetUserAsync(String, String, RequestOptions)​
Gets a user.
View Source​
Task<IUser> IDiscordClient.GetUserAsync(string username, string discriminator, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IUser>
:
A task that represents the asynchronous get operation. The task result contains the user associated with
the name and the discriminator; null
if the user is not found.
Parameters​
Type | Name | Description |
---|---|---|
System.String | username | The name of the user (e.g. Still ). |
System.String | discriminator | The discriminator value of the user (e.g. 2876 ). |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetVoiceRegionAsync(String, RequestOptions)​
Gets a voice region.
View Source​
async Task<IVoiceRegion> IDiscordClient.GetVoiceRegionAsync(string id, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IVoiceRegion>
:
A task that represents the asynchronous get operation. The task result contains the voice region
associated with the identifier; null
if the voice region is not found.
Parameters​
Type | Name | Description |
---|---|---|
System.String | id | The identifier of the voice region (e.g. eu-central ). |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetVoiceRegionsAsync(RequestOptions)​
Gets a collection of the available voice regions.
View Source​
async Task<IReadOnlyCollection<IVoiceRegion>> IDiscordClient.GetVoiceRegionsAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IVoiceRegion>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
with all of the available voice regions in this session.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
Events​
ChannelCreated​
Fired when a channel is created.
View Source​
public event Func<SocketChannel, Task> ChannelCreated
Event Type​
System.Func<Discord.WebSocket.SocketChannel,System.Threading.Tasks.Task>
ChannelDestroyed​
Fired when a channel is destroyed.
View Source​
public event Func<SocketChannel, Task> ChannelDestroyed
Event Type​
System.Func<Discord.WebSocket.SocketChannel,System.Threading.Tasks.Task>
ChannelUpdated​
Fired when a channel is updated.
View Source​
public event Func<SocketChannel, SocketChannel, Task> ChannelUpdated
Event Type​
System.Func<Discord.WebSocket.SocketChannel,Discord.WebSocket.SocketChannel,System.Threading.Tasks.Task>
MessageReceived​
Fired when a message is received.
View Source​
public event Func<SocketMessage, Task> MessageReceived
Event Type​
System.Func<Discord.WebSocket.SocketMessage,System.Threading.Tasks.Task>
MessageDeleted​
Fired when a message is deleted.
View Source​
public event Func<Cacheable<IMessage, ulong>, Cacheable<IMessageChannel, ulong>, Task> MessageDeleted
Event Type​
System.Func<Discord.Cacheable<Discord.IMessage,System.UInt64>,Discord.Cacheable<Discord.IMessageChannel,System.UInt64>,System.Threading.Tasks.Task>
MessagesBulkDeleted​
Fired when multiple messages are bulk deleted.
View Source​
public event Func<IReadOnlyCollection<Cacheable<IMessage, ulong>>, Cacheable<IMessageChannel, ulong>, Task> MessagesBulkDeleted
Event Type​
System.Func<System.Collections.Generic.IReadOnlyCollection<Discord.Cacheable<Discord.IMessage,System.UInt64>>,Discord.Cacheable<Discord.IMessageChannel,System.UInt64>,System.Threading.Tasks.Task>
MessageUpdated​
Fired when a message is updated.
View Source​
public event Func<Cacheable<IMessage, ulong>, SocketMessage, ISocketMessageChannel, Task> MessageUpdated
Event Type​
System.Func<Discord.Cacheable<Discord.IMessage,System.UInt64>,Discord.WebSocket.SocketMessage,Discord.WebSocket.ISocketMessageChannel,System.Threading.Tasks.Task>
ReactionAdded​
Fired when a reaction is added to a message.
View Source​
public event Func<Cacheable<IUserMessage, ulong>, Cacheable<IMessageChannel, ulong>, SocketReaction, Task> ReactionAdded
Event Type​
System.Func<Discord.Cacheable<Discord.IUserMessage,System.UInt64>,Discord.Cacheable<Discord.IMessageChannel,System.UInt64>,Discord.WebSocket.SocketReaction,System.Threading.Tasks.Task>
ReactionRemoved​
Fired when a reaction is removed from a message.
View Source​
public event Func<Cacheable<IUserMessage, ulong>, Cacheable<IMessageChannel, ulong>, SocketReaction, Task> ReactionRemoved
Event Type​
System.Func<Discord.Cacheable<Discord.IUserMessage,System.UInt64>,Discord.Cacheable<Discord.IMessageChannel,System.UInt64>,Discord.WebSocket.SocketReaction,System.Threading.Tasks.Task>
ReactionsCleared​
Fired when all reactions to a message are cleared.
View Source​
public event Func<Cacheable<IUserMessage, ulong>, Cacheable<IMessageChannel, ulong>, Task> ReactionsCleared
Event Type​
System.Func<Discord.Cacheable<Discord.IUserMessage,System.UInt64>,Discord.Cacheable<Discord.IMessageChannel,System.UInt64>,System.Threading.Tasks.Task>
ReactionsRemovedForEmote​
Fired when all reactions to a message with a specific emote are removed.
View Source​
public event Func<Cacheable<IUserMessage, ulong>, Cacheable<IMessageChannel, ulong>, IEmote, Task> ReactionsRemovedForEmote
Event Type​
System.Func<Discord.Cacheable<Discord.IUserMessage,System.UInt64>,Discord.Cacheable<Discord.IMessageChannel,System.UInt64>,Discord.IEmote,System.Threading.Tasks.Task>
RoleCreated​
Fired when a role is created.
View Source​
public event Func<SocketRole, Task> RoleCreated
Event Type​
System.Func<Discord.WebSocket.SocketRole,System.Threading.Tasks.Task>
RoleDeleted​
Fired when a role is deleted.
View Source​
public event Func<SocketRole, Task> RoleDeleted
Event Type​
System.Func<Discord.WebSocket.SocketRole,System.Threading.Tasks.Task>
RoleUpdated​
Fired when a role is updated.
View Source​
public event Func<SocketRole, SocketRole, Task> RoleUpdated
Event Type​
System.Func<Discord.WebSocket.SocketRole,Discord.WebSocket.SocketRole,System.Threading.Tasks.Task>
JoinedGuild​
Fired when the connected account joins a guild.
View Source​
public event Func<SocketGuild, Task> JoinedGuild
Event Type​
System.Func<Discord.WebSocket.SocketGuild,System.Threading.Tasks.Task>
LeftGuild​
Fired when the connected account leaves a guild.
View Source​
public event Func<SocketGuild, Task> LeftGuild
Event Type​
System.Func<Discord.WebSocket.SocketGuild,System.Threading.Tasks.Task>
GuildAvailable​
Fired when a guild becomes available.
View Source​
public event Func<SocketGuild, Task> GuildAvailable
Event Type​
System.Func<Discord.WebSocket.SocketGuild,System.Threading.Tasks.Task>
GuildUnavailable​
Fired when a guild becomes unavailable.
View Source​
public event Func<SocketGuild, Task> GuildUnavailable
Event Type​
System.Func<Discord.WebSocket.SocketGuild,System.Threading.Tasks.Task>
GuildMembersDownloaded​
Fired when offline guild members are downloaded.
View Source​
public event Func<SocketGuild, Task> GuildMembersDownloaded
Event Type​
System.Func<Discord.WebSocket.SocketGuild,System.Threading.Tasks.Task>
GuildUpdated​
Fired when a guild is updated.
View Source​
public event Func<SocketGuild, SocketGuild, Task> GuildUpdated
Event Type​
System.Func<Discord.WebSocket.SocketGuild,Discord.WebSocket.SocketGuild,System.Threading.Tasks.Task>
GuildJoinRequestDeleted​
Fired when a user leaves without agreeing to the member screening
View Source​
public event Func<Cacheable<SocketGuildUser, ulong>, SocketGuild, Task> GuildJoinRequestDeleted
Event Type​
System.Func<Discord.Cacheable<Discord.WebSocket.SocketGuildUser,System.UInt64>,Discord.WebSocket.SocketGuild,System.Threading.Tasks.Task>
GuildScheduledEventCreated​
Fired when a guild event is created.
View Source​
public event Func<SocketGuildEvent, Task> GuildScheduledEventCreated
Event Type​
System.Func<Discord.WebSocket.SocketGuildEvent,System.Threading.Tasks.Task>
GuildScheduledEventUpdated​
Fired when a guild event is updated.
View Source​
public event Func<Cacheable<SocketGuildEvent, ulong>, SocketGuildEvent, Task> GuildScheduledEventUpdated
Event Type​
System.Func<Discord.Cacheable<Discord.WebSocket.SocketGuildEvent,System.UInt64>,Discord.WebSocket.SocketGuildEvent,System.Threading.Tasks.Task>
GuildScheduledEventCancelled​
Fired when a guild event is cancelled.
View Source​
public event Func<SocketGuildEvent, Task> GuildScheduledEventCancelled
Event Type​
System.Func<Discord.WebSocket.SocketGuildEvent,System.Threading.Tasks.Task>
GuildScheduledEventCompleted​
Fired when a guild event is completed.
View Source​
public event Func<SocketGuildEvent, Task> GuildScheduledEventCompleted
Event Type​
System.Func<Discord.WebSocket.SocketGuildEvent,System.Threading.Tasks.Task>
GuildScheduledEventStarted​
Fired when a guild event is started.
View Source​
public event Func<SocketGuildEvent, Task> GuildScheduledEventStarted
Event Type​
System.Func<Discord.WebSocket.SocketGuildEvent,System.Threading.Tasks.Task>
GuildScheduledEventUserAdd​
View Source​
public event Func<Cacheable<SocketUser, RestUser, IUser, ulong>, SocketGuildEvent, Task> GuildScheduledEventUserAdd
Event Type​
System.Func<Discord.Cacheable<Discord.WebSocket.SocketUser,Discord.Rest.RestUser,Discord.IUser,System.UInt64>,Discord.WebSocket.SocketGuildEvent,System.Threading.Tasks.Task>
GuildScheduledEventUserRemove​
View Source​
public event Func<Cacheable<SocketUser, RestUser, IUser, ulong>, SocketGuildEvent, Task> GuildScheduledEventUserRemove
Event Type​
System.Func<Discord.Cacheable<Discord.WebSocket.SocketUser,Discord.Rest.RestUser,Discord.IUser,System.UInt64>,Discord.WebSocket.SocketGuildEvent,System.Threading.Tasks.Task>
UserJoined​
Fired when a user joins a guild.
View Source​
public event Func<SocketGuildUser, Task> UserJoined
Event Type​
System.Func<Discord.WebSocket.SocketGuildUser,System.Threading.Tasks.Task>
UserLeft​
Fired when a user leaves a guild.
View Source​
public event Func<SocketGuildUser, Task> UserLeft
Event Type​
System.Func<Discord.WebSocket.SocketGuildUser,System.Threading.Tasks.Task>
UserBanned​
Fired when a user is banned from a guild.
View Source​
public event Func<SocketUser, SocketGuild, Task> UserBanned
Event Type​
System.Func<Discord.WebSocket.SocketUser,Discord.WebSocket.SocketGuild,System.Threading.Tasks.Task>
UserUnbanned​
Fired when a user is unbanned from a guild.
View Source​
public event Func<SocketUser, SocketGuild, Task> UserUnbanned
Event Type​
System.Func<Discord.WebSocket.SocketUser,Discord.WebSocket.SocketGuild,System.Threading.Tasks.Task>
UserUpdated​
Fired when a user is updated.
View Source​
public event Func<SocketUser, SocketUser, Task> UserUpdated
Event Type​
System.Func<Discord.WebSocket.SocketUser,Discord.WebSocket.SocketUser,System.Threading.Tasks.Task>
GuildMemberUpdated​
Fired when a guild member is updated, or a member presence is updated.
View Source​
public event Func<Cacheable<SocketGuildUser, ulong>, SocketGuildUser, Task> GuildMemberUpdated
Event Type​
System.Func<Discord.Cacheable<Discord.WebSocket.SocketGuildUser,System.UInt64>,Discord.WebSocket.SocketGuildUser,System.Threading.Tasks.Task>
UserVoiceStateUpdated​
Fired when a user joins, leaves, or moves voice channels.
View Source​
public event Func<SocketUser, SocketVoiceState, SocketVoiceState, Task> UserVoiceStateUpdated
Event Type​
System.Func<Discord.WebSocket.SocketUser,Discord.WebSocket.SocketVoiceState,Discord.WebSocket.SocketVoiceState,System.Threading.Tasks.Task>
VoiceServerUpdated​
Fired when the bot connects to a Discord voice server.
View Source​
public event Func<SocketVoiceServer, Task> VoiceServerUpdated
Event Type​
System.Func<Discord.WebSocket.SocketVoiceServer,System.Threading.Tasks.Task>
CurrentUserUpdated​
Fired when the connected account is updated.
View Source​
public event Func<SocketSelfUser, SocketSelfUser, Task> CurrentUserUpdated
Event Type​
System.Func<Discord.WebSocket.SocketSelfUser,Discord.WebSocket.SocketSelfUser,System.Threading.Tasks.Task>
UserIsTyping​
Fired when a user starts typing.
View Source​
public event Func<Cacheable<IUser, ulong>, Cacheable<IMessageChannel, ulong>, Task> UserIsTyping
Event Type​
System.Func<Discord.Cacheable<Discord.IUser,System.UInt64>,Discord.Cacheable<Discord.IMessageChannel,System.UInt64>,System.Threading.Tasks.Task>
RecipientAdded​
Fired when a user joins a group channel.
View Source​
public event Func<SocketGroupUser, Task> RecipientAdded
Event Type​
System.Func<Discord.WebSocket.SocketGroupUser,System.Threading.Tasks.Task>
RecipientRemoved​
Fired when a user is removed from a group channel.
View Source​
public event Func<SocketGroupUser, Task> RecipientRemoved
Event Type​
System.Func<Discord.WebSocket.SocketGroupUser,System.Threading.Tasks.Task>
PresenceUpdated​
Fired when a users presence is updated.
View Source​
public event Func<SocketUser, SocketPresence, SocketPresence, Task> PresenceUpdated
Event Type​
System.Func<Discord.WebSocket.SocketUser,Discord.WebSocket.SocketPresence,Discord.WebSocket.SocketPresence,System.Threading.Tasks.Task>
InviteCreated​
Fired when an invite is created.
View Source​
public event Func<SocketInvite, Task> InviteCreated
Event Type​
System.Func<Discord.WebSocket.SocketInvite,System.Threading.Tasks.Task>
InviteDeleted​
Fired when an invite is deleted.
View Source​
public event Func<SocketGuildChannel, string, Task> InviteDeleted
Event Type​
System.Func<Discord.WebSocket.SocketGuildChannel,System.String,System.Threading.Tasks.Task>
InteractionCreated​
Fired when an Interaction is created. This event covers all types of interactions including but not limited to: buttons, select menus, slash commands, autocompletes.
View Source​
public event Func<SocketInteraction, Task> InteractionCreated
Event Type​
System.Func<Discord.WebSocket.SocketInteraction,System.Threading.Tasks.Task>
ButtonExecuted​
Fired when a button is clicked and its interaction is received.
View Source​
public event Func<SocketMessageComponent, Task> ButtonExecuted
Event Type​
System.Func<Discord.WebSocket.SocketMessageComponent,System.Threading.Tasks.Task>
SelectMenuExecuted​
Fired when a select menu is used and its interaction is received.
View Source​
public event Func<SocketMessageComponent, Task> SelectMenuExecuted
Event Type​
System.Func<Discord.WebSocket.SocketMessageComponent,System.Threading.Tasks.Task>
SlashCommandExecuted​
Fired when a slash command is used and its interaction is received.
View Source​
public event Func<SocketSlashCommand, Task> SlashCommandExecuted
Event Type​
System.Func<Discord.WebSocket.SocketSlashCommand,System.Threading.Tasks.Task>
UserCommandExecuted​
Fired when a user command is used and its interaction is received.
View Source​
public event Func<SocketUserCommand, Task> UserCommandExecuted
Event Type​
System.Func<Discord.WebSocket.SocketUserCommand,System.Threading.Tasks.Task>
MessageCommandExecuted​
Fired when a message command is used and its interaction is received.
View Source​
public event Func<SocketMessageCommand, Task> MessageCommandExecuted
Event Type​
System.Func<Discord.WebSocket.SocketMessageCommand,System.Threading.Tasks.Task>
AutocompleteExecuted​
Fired when an autocomplete is used and its interaction is received.
View Source​
public event Func<SocketAutocompleteInteraction, Task> AutocompleteExecuted
Event Type​
System.Func<Discord.WebSocket.SocketAutocompleteInteraction,System.Threading.Tasks.Task>
ApplicationCommandCreated​
Fired when a guild application command is created.
View Source​
public event Func<SocketApplicationCommand, Task> ApplicationCommandCreated
Event Type​
System.Func<Discord.WebSocket.SocketApplicationCommand,System.Threading.Tasks.Task>
ApplicationCommandUpdated​
Fired when a guild application command is updated.
View Source​
public event Func<SocketApplicationCommand, Task> ApplicationCommandUpdated
Event Type​
System.Func<Discord.WebSocket.SocketApplicationCommand,System.Threading.Tasks.Task>
ApplicationCommandDeleted​
Fired when a guild application command is deleted.
View Source​
public event Func<SocketApplicationCommand, Task> ApplicationCommandDeleted
Event Type​
System.Func<Discord.WebSocket.SocketApplicationCommand,System.Threading.Tasks.Task>
ThreadCreated​
Fired when a thread is created within a guild, or when the current user is added to a thread.
View Source​
public event Func<SocketThreadChannel, Task> ThreadCreated
Event Type​
System.Func<Discord.WebSocket.SocketThreadChannel,System.Threading.Tasks.Task>
ThreadUpdated​
Fired when a thread is updated within a guild.
View Source​
public event Func<Cacheable<SocketThreadChannel, ulong>, SocketThreadChannel, Task> ThreadUpdated
Event Type​
System.Func<Discord.Cacheable<Discord.WebSocket.SocketThreadChannel,System.UInt64>,Discord.WebSocket.SocketThreadChannel,System.Threading.Tasks.Task>
ThreadDeleted​
Fired when a thread is deleted.
View Source​
public event Func<Cacheable<SocketThreadChannel, ulong>, Task> ThreadDeleted
Event Type​
System.Func<Discord.Cacheable<Discord.WebSocket.SocketThreadChannel,System.UInt64>,System.Threading.Tasks.Task>
ThreadMemberJoined​
Fired when a user joins a thread
View Source​
public event Func<SocketThreadUser, Task> ThreadMemberJoined
Event Type​
System.Func<Discord.WebSocket.SocketThreadUser,System.Threading.Tasks.Task>
ThreadMemberLeft​
Fired when a user leaves a thread
View Source​
public event Func<SocketThreadUser, Task> ThreadMemberLeft
Event Type​
System.Func<Discord.WebSocket.SocketThreadUser,System.Threading.Tasks.Task>
StageStarted​
Fired when a stage is started.
View Source​
public event Func<SocketStageChannel, Task> StageStarted
Event Type​
System.Func<Discord.WebSocket.SocketStageChannel,System.Threading.Tasks.Task>
StageEnded​
Fired when a stage ends.
View Source​
public event Func<SocketStageChannel, Task> StageEnded
Event Type​
System.Func<Discord.WebSocket.SocketStageChannel,System.Threading.Tasks.Task>
StageUpdated​
Fired when a stage is updated.
View Source​
public event Func<SocketStageChannel, SocketStageChannel, Task> StageUpdated
Event Type​
System.Func<Discord.WebSocket.SocketStageChannel,Discord.WebSocket.SocketStageChannel,System.Threading.Tasks.Task>
RequestToSpeak​
Fired when a user requests to speak within a stage channel.
View Source​
public event Func<SocketStageChannel, SocketGuildUser, Task> RequestToSpeak
Event Type​
System.Func<Discord.WebSocket.SocketStageChannel,Discord.WebSocket.SocketGuildUser,System.Threading.Tasks.Task>
SpeakerAdded​
Fired when a speaker is added in a stage channel.
View Source​
public event Func<SocketStageChannel, SocketGuildUser, Task> SpeakerAdded
Event Type​
System.Func<Discord.WebSocket.SocketStageChannel,Discord.WebSocket.SocketGuildUser,System.Threading.Tasks.Task>
SpeakerRemoved​
Fired when a speaker is removed from a stage channel.
View Source​
public event Func<SocketStageChannel, SocketGuildUser, Task> SpeakerRemoved
Event Type​
System.Func<Discord.WebSocket.SocketStageChannel,Discord.WebSocket.SocketGuildUser,System.Threading.Tasks.Task>
GuildStickerCreated​
Fired when a sticker in a guild is created.
View Source​
public event Func<SocketCustomSticker, Task> GuildStickerCreated
Event Type​
System.Func<Discord.WebSocket.SocketCustomSticker,System.Threading.Tasks.Task>
GuildStickerUpdated​
Fired when a sticker in a guild is updated.
View Source​
public event Func<SocketCustomSticker, SocketCustomSticker, Task> GuildStickerUpdated
Event Type​
System.Func<Discord.WebSocket.SocketCustomSticker,Discord.WebSocket.SocketCustomSticker,System.Threading.Tasks.Task>
GuildStickerDeleted​
Fired when a sticker in a guild is deleted.
View Source​
public event Func<SocketCustomSticker, Task> GuildStickerDeleted
Event Type​
System.Func<Discord.WebSocket.SocketCustomSticker,System.Threading.Tasks.Task>
Implements​
- Discord.IDiscordClient
System.IDisposable