Client
The main client used to interact with Discord
Extends
Constructors
new Client()
new Client(
options
,commands
):Client
Creates a new client
Parameters
Parameter | Type | Description |
---|---|---|
options | ClientOptions | The options used to initialize the client |
commands | BaseCommand [] | The commands that the client has registered |
Returns
Overrides
Properties
Property | Type | Default value | Description | Inherited from |
---|---|---|---|---|
commandHandler | CommandHandler | undefined | Internal The handler for the modal interactions sent from Discord | - |
commands | BaseCommand [] | undefined | The commands that the client has registered | - |
componentHandler | ComponentHandler | undefined | Internal The handler for the component interactions sent from Discord | - |
modalHandler | ModalHandler | undefined | Internal The handler for the modal interactions sent from Discord | - |
options | ClientOptions | undefined | The options used to initialize the client | - |
rest | RequestClient | undefined | The rest client used to interact with the Discord API | - |
routes | Route [] | [] | - | Plugin .routes |
Methods
fetchChannel()
fetchChannel(
id
):Promise
<null
|GuildCategoryChannel
<false
> |DmChannel
<false
> |GroupDmChannel
<false
> |GuildTextChannel
<false
> |GuildVoiceChannel
<false
> |GuildAnnouncementChannel
<false
> |GuildThreadChannel
<ThreadChannelType
,false
> |GuildStageChannel
<false
> |GuildForumChannel
<false
> |GuildMediaChannel
>
Fetch a channel from the Discord API
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The ID of the channel to fetch |
Returns
Promise
<null
| GuildCategoryChannel
<false
> | DmChannel
<false
> | GroupDmChannel
<false
> | GuildTextChannel
<false
> | GuildVoiceChannel
<false
> | GuildAnnouncementChannel
<false
> | GuildThreadChannel
<ThreadChannelType
, false
> | GuildStageChannel
<false
> | GuildForumChannel
<false
> | GuildMediaChannel
>
The channel data
fetchGuild()
Fetch a guild from the Discord API
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The ID of the guild to fetch |
Returns
The guild data
fetchMember()
fetchMember(
guildId
,id
):Promise
<GuildMember
<false
,true
>>
Fetch a member from the Discord API
Parameters
Parameter | Type | Description |
---|---|---|
guildId | string | The ID of the guild the member is in |
id | string | The ID of the member to fetch |
Returns
Promise
<GuildMember
<false
, true
>>
The member data
fetchRole()
Fetch a role from the Discord API
Parameters
Parameter | Type | Description |
---|---|---|
guildId | string | - |
id | string | The ID of the role to fetch |
Returns
The role data
fetchUser()
Fetch a user from the Discord API
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The ID of the user to fetch |
Returns
The user data
handleDeployRequest()
Handle a request to deploy the commands to Discord
Returns
A response
handleInteractionsRequest()
Handle an interaction request from Discord
Parameters
Returns
A response