DiscordSocketClient

Namespace: Discord.Gateway

Inherits from

pageDiscordClient

Events

Note: All event names here have had the 'On' at the start of them removed.

Name

Description

LoggedIn

When the client has connected and authenticated to the gateway

LoggedOut

When the client gets disconnected from the gateway

SettingsUpdated

When the client's current user's settings get updated

SessionsUpdated

When a client logs into/out of the current user

UserUpdated

When a user relevant to the client's user gets updated

JoinedGuild

When the client joins/creates a guild

GuildUpdated

When a guild gets updated

LeftGuild

When the client leaves/gets removed from a guild

UserJoinedGuild

When a user joins a guild

UserLeftGuild

When a user leaves a guild

GuildMemberUpdated

When a guild's member gets updated

UserPresenceUpdated

When a user's presence (aka their activities and status) get updated

RoleCreated

When a new role is created

RoleUpdated

When a role is updated

RoleDeleted

When a role is deleted

ChannelCreated

When a new channel is created

ChannelUpdated

When a channel gets updated

ChannelDeleted

When a channel gets deleted

Ringing

When the current user or another user have started a call

CallUpdated

When a call gets updated

CallEnded

When a call ends

InviteCreated

When a new invite is created

InviteDeleted

When an invite is deleted

VoiceStateUpdate

When a user's voice state updates

EmojisUpdated

When a guild's emojis get updated

UserTyping

When a user triggers the 'user is typing...' signal

MessageReceived

When a new message is received

MessageEdited

When a message gets edited

MessageDeleted

When a message gets deleted

MessageReactionAdded

When a reaction gets added to a message

MessageReactionRemoved

When a reaction gets removed from a message

UserBanned

When a user gets banned from a guild

UserUnbanned

When a user gets unbanned from a guild

RelationshipAdded

When a new relationship is created

RelationshipRemoved

When a relationship is removed

GiftCodeCreated

When the client generates a code for one of it's gifts

GiftUpdated

Triggered when a gift you've interacted with in a channel gets updated. The .Json member is available, because there's uncertainty of what can be updated. If you find any other than "uses", please create an issue.

OnBoostSlotCreated

When a boost slot is created

OnBoostSlotUpdated

When a boost slot is updated (e.g. it's being used on a guild)

OnEntitlementCreated

Entitlements have something to do with gifts, but research is incomplete

OnEntitlementUpdated

When an entitlement is updated

Properties

Name

Description

Type

UserSettings

The current user's settings

DiscordUserSettings

CommandHandler

The client's command handler

CommandHandler

Config

The client's configuration

LockedDiscordSocketConfig

LoggedIn

Indicates if the client is connected to the gateway

bool

SessionId

The client's current gateway session ID

string

State

The connection state

GatewayConnectionState

Methods

Constructor

Parameters

Name

Description

Type

config

Your desired configuration

DiscordSocketConfig?

Login

Logs the client into the gateway.

Parameters

Name

Description

Type

token

The auth token you wanna log in with

string

Logout

Disconnects from the gateway.

CreateCommandHandler

Creates a command handler for the client.

Parameters

Name

Description

Type

prefix

The prefix you want for commands

string

GetVoiceState

Gets a user's voice state. This method requires caching to be enabled to work.

Parameters

Name

Description

Type

userId

The user's ID

ulong

Returns

pageDiscordVoiceState

GetGuildVoiceStates

Gets all voice states where the user is connected to a voice channel within the guild. This method requires caching to be enabled to work.

Parameters

Name

Description

Type

guildId

ID of the guild

ulong

Returns

A list of

pageDiscordVoiceState

GetChannelVoiceStates

Gets all voice states where the user is connected to the channel. This method requires caching to be enabled to work.

Parameters

Name

Description

Type

channelId

ID of the channel

ulong

Returns

A list of

pageDiscordVoiceState

GetCachedGuilds

Gets all the client's cached guilds.

Returns

A list of

pageSocketGuild

GetChachedGuild

Gets one of the client's cached guilds.

Parameters

Name

Description

Type

guildId

ID of the guild

ulong

Returns

pageSocketGuild

GetGuildSettings

Gets the current user's settings for a guild. This method requires caching to be enabled to work.

Parameters

Name

Description

Type

guildId

ID of the guild

ulong

Returns

pageClientGuildSettings

GetChannelSettings

Gets the current user's settings for that channel. This method requires caching to be enabled to work.

Parameters

Name

Description

Type

channelId

ID of the channel

ulong

Returns

pageDiscordChannelSettings

UpdatePresence

Updates the current user's presence.

Parameters

Name

Description

Type

presence

Your new presence

PresenceChange

SetStatus

Updates the current user's status.

Parameters

Name

Description

Type

status

Your new status

UserStatus

SetActivity

Updates the current user's activity.

Parameters

Name

Description

Type

activity

Your new activity. GameActivity and StreamActivity are available if that's what you want to do.

Activity

ChangeVoiceState

Changes the current user's voice channel.

Parameters

Name

Description

Type

state

Your new voice state

VoiceStateChange

JoinVoiceChannel

Joins a voice channel. Anarchy also allows you to join private channel calls.

Parameters

Name

Description

Type

guildId

If you want to join a guild's voice channel, put that here. Otherwise leave as null

ulong?

channelId

The channel you want to join

ulong

muted

Whether or not you want to mute yourself

bool?

deafened

Whether or not you want to deafen yourself

bool?

Returns

Last updated