mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat: add links to each routes documentation (#8898)
This commit is contained in:
@@ -24,6 +24,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Fetches all global commands for a application
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
|
||||
* @param applicationId - The application id to fetch commands for
|
||||
* @param options - The options to use when fetching commands
|
||||
*/
|
||||
@@ -36,6 +37,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Creates a new global command
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
|
||||
* @param applicationId - The application id to create the command for
|
||||
* @param data - The data to use when creating the command
|
||||
*/
|
||||
@@ -48,6 +50,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Fetches a global command
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-command}
|
||||
* @param applicationId - The application id to fetch the command from
|
||||
* @param commandId - The command id to fetch
|
||||
*/
|
||||
@@ -60,6 +63,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Edits a global command
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
|
||||
* @param applicationId - The application id of the command
|
||||
* @param commandId - The id of the command to edit
|
||||
* @param data - The data to use when editing the command
|
||||
@@ -77,6 +81,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Deletes a global command
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
|
||||
* @param applicationId - The application id of the command
|
||||
* @param commandId - The id of the command to delete
|
||||
*/
|
||||
@@ -87,6 +92,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Overwrites global commands
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands}
|
||||
* @param applicationId - The application id to overwrite commands for
|
||||
* @param data - The data to use when overwriting commands
|
||||
*/
|
||||
@@ -99,6 +105,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Fetches all commands for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands}
|
||||
* @param applicationId - The application id to fetch commands for
|
||||
* @param guildId - The guild id to fetch commands for
|
||||
* @param data - The data to use when fetching commands
|
||||
@@ -116,6 +123,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Creates a new command for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
|
||||
* @param applicationId - The application id to create the command for
|
||||
* @param guildId - The guild id to create the command for
|
||||
* @param data - The data to use when creating the command
|
||||
@@ -133,6 +141,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Fetches a guild command
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command}
|
||||
* @param applicationId - The application id to fetch the command from
|
||||
* @param guildId - The guild id to fetch the command from
|
||||
* @param commandId - The command id to fetch
|
||||
@@ -146,6 +155,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Edits a guild command
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
|
||||
* @param applicationId - The application id of the command
|
||||
* @param guildId - The guild id of the command
|
||||
* @param commandId - The command id to edit
|
||||
@@ -165,6 +175,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Deletes a guild command
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
|
||||
* @param applicationId - The application id of the command
|
||||
* @param guildId - The guild id of the command
|
||||
* @param commandId - The id of the command to delete
|
||||
@@ -176,6 +187,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Bulk overwrites guild commands
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands}
|
||||
* @param applicationId - The application id to overwrite commands for
|
||||
* @param guildId - The guild id to overwrite commands for
|
||||
* @param data - The data to use when overwriting commands
|
||||
@@ -193,6 +205,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Fetches the permissions for a guild command
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
|
||||
* @param applicationId - The application id to get the permissions for
|
||||
* @param guildId - The guild id of the command
|
||||
* @param commandId - The command id to get the permissions for
|
||||
@@ -206,6 +219,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Fetches all permissions for all commands in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
|
||||
* @param applicationId - The application id to get the permissions for
|
||||
* @param guildId - The guild id to get the permissions for
|
||||
*/
|
||||
@@ -218,6 +232,7 @@ export class ApplicationCommandsAPI {
|
||||
/**
|
||||
* Edits the permissions for a guild command
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
|
||||
* @param userToken - The token of the user to edit permissions on behalf of
|
||||
* @param applicationId - The application id to edit the permissions for
|
||||
* @param guildId - The guild id to edit the permissions for
|
||||
|
||||
@@ -30,6 +30,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Sends a message in a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#create-message}
|
||||
* @param channelId - The id of the channel to send the message in
|
||||
* @param data - The data to use when sending the message
|
||||
*/
|
||||
@@ -46,6 +47,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Edits a message
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#edit-message}
|
||||
* @param channelId - The id of the channel the message is in
|
||||
* @param messageId - The id of the message to edit
|
||||
* @param data - The data to use when editing the message
|
||||
@@ -64,6 +66,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Fetches the reactions for a message
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#get-reactions}
|
||||
* @param channelId - The id of the channel the message is in
|
||||
* @param messageId - The id of the message to get the reactions for
|
||||
* @param emoji - The emoji to get the reactions for
|
||||
@@ -83,6 +86,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Deletes a reaction for the current user
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#delete-own-reaction}
|
||||
* @param channelId - The id of the channel the message is in
|
||||
* @param messageId - The id of the message to delete the reaction for
|
||||
* @param emoji - The emoji to delete the reaction for
|
||||
@@ -94,6 +98,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Deletes a reaction for a user
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#delete-user-reaction}
|
||||
* @param channelId - The id of the channel the message is in
|
||||
* @param messageId - The id of the message to delete the reaction for
|
||||
* @param emoji - The emoji to delete the reaction for
|
||||
@@ -106,6 +111,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Deletes all reactions for a message
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions}
|
||||
* @param channelId - The id of the channel the message is in
|
||||
* @param messageId - The id of the message to delete the reactions for
|
||||
*/
|
||||
@@ -116,6 +122,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Deletes all reactions of an emoji for a message
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji}
|
||||
* @param channelId - The id of the channel the message is in
|
||||
* @param messageId - The id of the message to delete the reactions for
|
||||
* @param emoji - The emoji to delete the reactions for
|
||||
@@ -127,6 +134,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Adds a reaction to a message
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#create-reaction}
|
||||
* @param channelId - The id of the channel the message is in
|
||||
* @param messageId - The id of the message to add the reaction to
|
||||
* @param emoji - The emoji to add the reaction with
|
||||
@@ -138,6 +146,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Fetches a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
|
||||
* @param channelId - The id of the channel
|
||||
*/
|
||||
public async get(channelId: Snowflake) {
|
||||
@@ -147,6 +156,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Edits a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#modify-channel}
|
||||
* @param channelId - The id of the channel to edit
|
||||
* @param data - The new channel data
|
||||
*/
|
||||
@@ -157,6 +167,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Deletes a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#deleteclose-channel}
|
||||
* @param channelId - The id of the channel to delete
|
||||
*/
|
||||
public async delete(channelId: Snowflake) {
|
||||
@@ -166,6 +177,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Fetches the messages of a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-messages}
|
||||
* @param channelId - The id of the channel to fetch messages from
|
||||
* @param options - The options to use when fetching messages
|
||||
*/
|
||||
@@ -178,6 +190,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Shows a typing indicator in a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#trigger-typing-indicator}
|
||||
* @param channelId - The id of the channel to show the typing indicator in
|
||||
*/
|
||||
public async showTyping(channelId: Snowflake) {
|
||||
@@ -187,6 +200,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Fetches the pinned messages of a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages}
|
||||
* @param channelId - The id of the channel to fetch pinned messages from
|
||||
*/
|
||||
public async getPins(channelId: Snowflake) {
|
||||
@@ -196,6 +210,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Pins a message in a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#pin-message}
|
||||
* @param channelId - The id of the channel to pin the message in
|
||||
* @param messageId - The id of the message to pin
|
||||
* @param reason - The reason for pinning the message
|
||||
@@ -207,6 +222,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Deletes a message
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
|
||||
* @param channelId - The id of the channel the message is in
|
||||
* @param messageId - The id of the message to delete
|
||||
* @param reason - The reason for deleting the message
|
||||
@@ -218,6 +234,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Bulk deletes messages
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#bulk-delete-messages}
|
||||
* @param channelId - The id of the channel the messages are in
|
||||
* @param messageIds - The ids of the messages to delete
|
||||
*/
|
||||
@@ -228,6 +245,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Fetches a message
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-message}
|
||||
* @param channelId - The id of the channel the message is in
|
||||
* @param messageId - The id of the message to fetch
|
||||
*/
|
||||
@@ -238,6 +256,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Crossposts a message
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
|
||||
* @param channelId - The id of the channel the message is in
|
||||
* @param messageId - The id of the message to crosspost
|
||||
*/
|
||||
@@ -250,6 +269,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Unpins a message in a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#unpin-message}
|
||||
* @param channelId - The id of the channel to unpin the message in
|
||||
* @param messageId - The id of the message to unpin
|
||||
* @param reason - The reason for unpinning the message
|
||||
@@ -261,6 +281,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Follows an announcement channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
|
||||
* @param channelId - The id of the announcement channel to follow
|
||||
* @param webhookChannelId - The id of the webhook channel to follow the announcements in
|
||||
*/
|
||||
@@ -273,6 +294,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Creates a new invite for a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
|
||||
* @param channelId - The id of the channel to create an invite for
|
||||
* @param data - The data to use when creating the invite
|
||||
*/
|
||||
@@ -286,6 +308,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Fetches the invites of a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-invites}
|
||||
* @param channelId - The id of the channel to fetch invites from
|
||||
*/
|
||||
public async getInvites(channelId: Snowflake) {
|
||||
@@ -295,6 +318,8 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Fetches the archived threads of a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#list-private-archived-threads}
|
||||
* @param channelId - The id of the channel to fetch archived threads from
|
||||
* @param archivedStatus - The archived status of the threads to fetch
|
||||
* @param options - The options to use when fetching archived threads
|
||||
@@ -312,6 +337,7 @@ export class ChannelsAPI {
|
||||
/**
|
||||
* Fetches the private joined archived threads of a channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
|
||||
* @param channelId - The id of the channel to fetch joined archived threads from
|
||||
* @param options - The options to use when fetching joined archived threads
|
||||
*/
|
||||
|
||||
@@ -91,6 +91,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
|
||||
* @param guildId - The id of the guild
|
||||
*/
|
||||
public async get(guildId: string) {
|
||||
@@ -100,6 +101,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches a guild preview
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-preview}
|
||||
* @param guildId - The id of the guild to fetch the preview from
|
||||
*/
|
||||
public async getPreview(guildId: Snowflake) {
|
||||
@@ -109,6 +111,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Creates a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
|
||||
* @param data - The guild to create
|
||||
*/
|
||||
public async create(data: RESTPostAPIGuildsJSONBody) {
|
||||
@@ -118,6 +121,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
|
||||
* @param guildId - The id of the guild to edit
|
||||
* @param data - The new guild data
|
||||
* @param reason - The reason for editing this guild
|
||||
@@ -129,6 +133,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Deletes a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
|
||||
* @param guildId - The id of the guild to delete
|
||||
* @param reason - The reason for deleting this guild
|
||||
*/
|
||||
@@ -139,6 +144,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches all the members of a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
|
||||
* @param guildId - The id of the guild
|
||||
* @param options - The options to use when fetching the guild members
|
||||
*/
|
||||
@@ -151,6 +157,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches a guild's channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
|
||||
* @param guildId - The id of the guild to fetch the channels from
|
||||
*/
|
||||
public async getChannels(guildId: Snowflake) {
|
||||
@@ -160,6 +167,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Creates a guild channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
|
||||
* @param guildId - The id of the guild to create the channel in
|
||||
* @param data - The data to create the new channel
|
||||
* @param reason - The reason for creating this channel
|
||||
@@ -174,6 +182,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits a guild channel's positions
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions}
|
||||
* @param guildId - The id of the guild to edit the channel positions from
|
||||
* @param data - The data to edit the channel positions with
|
||||
* @param reason - The reason for editing the channel positions
|
||||
@@ -189,6 +198,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches the active threads in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#list-active-guild-threads}
|
||||
* @param guildId - The id of the guild to fetch the active threads from
|
||||
*/
|
||||
public async getActiveThreads(guildId: Snowflake) {
|
||||
@@ -198,6 +208,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches a guild member ban
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
|
||||
* @param guildId - The id of the guild to fetch the ban from
|
||||
*/
|
||||
public async getMemberBans(guildId: Snowflake) {
|
||||
@@ -207,6 +218,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Bans a user from a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban}
|
||||
* @param guildId - The id of the guild to ban the member in
|
||||
* @param userId - The id of the user to ban
|
||||
* @param options - Options for banning the user
|
||||
@@ -224,6 +236,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Unbans a user from a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
|
||||
* @param guildId - The id of the guild to unban the member in
|
||||
* @param userId - The id of the user to unban
|
||||
* @param reason - The reason for unbanning the user
|
||||
@@ -235,6 +248,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Gets all the roles in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-roles}
|
||||
* @param guildId - The id of the guild to fetch the roles from
|
||||
*/
|
||||
public async getRoles(guildId: Snowflake) {
|
||||
@@ -244,6 +258,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Creates a guild role
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-role}
|
||||
* @param guildId - The id of the guild to create the role in
|
||||
* @param data - The data to create the role with
|
||||
* @param reason - The reason for creating the role
|
||||
@@ -255,6 +270,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Sets role positions in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role-positions}
|
||||
* @param guildId - The id of the guild to set role positions for
|
||||
* @param data - The data for setting a role position
|
||||
* @param reason - The reason for setting the role position
|
||||
@@ -269,6 +285,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits a guild role
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role}
|
||||
* @param guildId - The id of the guild to edit the role in
|
||||
* @param roleId - The id of the role to edit
|
||||
* @param data - data for editing the role
|
||||
@@ -284,6 +301,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Deletes a guild role
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-role}
|
||||
* @param guildId - The id of the guild to delete the role in
|
||||
* @param roleId - The id of the role to delete
|
||||
* @param reason - The reason for deleting the role
|
||||
@@ -295,6 +313,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits the multi-factor-authentication (MFA) level of a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level}
|
||||
* @param guildId - The id of the guild to edit the MFA level for
|
||||
* @param level - The new MFA level
|
||||
* @param reason - The reason for editing the MFA level
|
||||
@@ -309,6 +328,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetch the number of members that can be pruned from a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-prune-count}
|
||||
* @param guildId - The id of the guild to fetch the number of pruned members from
|
||||
* @param options - The options for fetching the number of pruned members
|
||||
*/
|
||||
@@ -321,6 +341,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Prunes members in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#begin-guild-prune}
|
||||
* @param guildId - The id of the guild to prune members in
|
||||
* @param options - The options for pruning members
|
||||
* @param reason - The reason for pruning members
|
||||
@@ -335,6 +356,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches voice regions for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
|
||||
* @param guildId - The id of the guild to fetch the voice regions from
|
||||
*/
|
||||
public async getVoiceRegions(guildId: Snowflake) {
|
||||
@@ -344,6 +366,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches the invites for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-invites}
|
||||
* @param guildId - The id of the guild to fetch the invites from
|
||||
*/
|
||||
public async getInvites(guildId: Snowflake) {
|
||||
@@ -353,6 +376,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches the integrations for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-integrations}
|
||||
* @param guildId - The id of the guild to fetch the integrations from
|
||||
*/
|
||||
public async getIntegrations(guildId: Snowflake) {
|
||||
@@ -362,6 +386,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Deletes an integration from a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-integration}
|
||||
* @param guildId - The id of the guild to delete the integration from
|
||||
* @param integrationId - The id of the integration to delete
|
||||
* @param reason - The reason for deleting the integration
|
||||
@@ -373,6 +398,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches the widget settings for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget-settings}
|
||||
* @param guildId - The id of the guild to fetch the widget settings from
|
||||
*/
|
||||
public async getWidgetSettings(guildId: Snowflake) {
|
||||
@@ -382,6 +408,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits the widget settings for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-widget}
|
||||
* @param guildId - The id of the guild to edit the widget settings from
|
||||
* @param data - The new widget settings data
|
||||
* @param reason - The reason for editing the widget settings
|
||||
@@ -396,6 +423,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches the widget for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget}
|
||||
* @param guildId - The id of the guild to fetch the widget from
|
||||
*/
|
||||
public async getWidget(guildId: Snowflake) {
|
||||
@@ -405,6 +433,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches the vanity url for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
|
||||
* @param guildId - The id of the guild to fetch the vanity url from
|
||||
*/
|
||||
public async getVanityURL(guildId: Snowflake) {
|
||||
@@ -414,6 +443,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches the widget image for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget-image}
|
||||
* @param guildId - The id of the guild to fetch the widget image from
|
||||
* @param style - The style of the widget image
|
||||
*/
|
||||
@@ -426,6 +456,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches the welcome screen for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen}
|
||||
* @param guildId - The id of the guild to fetch the welcome screen from
|
||||
*/
|
||||
public async getWelcomeScreen(guildId: Snowflake) {
|
||||
@@ -435,6 +466,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits the welcome screen for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen}
|
||||
* @param guildId - The id of the guild to edit the welcome screen for
|
||||
* @param data - The new welcome screen data
|
||||
* @param reason - The reason for editing the welcome screen
|
||||
@@ -449,6 +481,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits a user's voice state in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-user-voice-state}
|
||||
* @param guildId - The id of the guild to edit the current user's voice state in
|
||||
* @param userId - The id of the user to edit the voice state for
|
||||
* @param data - The data for editing the voice state
|
||||
@@ -466,6 +499,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches all emojis for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
|
||||
* @param guildId - The id of the guild to fetch the emojis from
|
||||
*/
|
||||
public async getEmojis(guildId: Snowflake) {
|
||||
@@ -475,6 +509,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches an emoji for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#get-guild-emoji}
|
||||
* @param guildId - The id of the guild to fetch the emoji from
|
||||
* @param emojiId - The id of the emoji to fetch
|
||||
*/
|
||||
@@ -485,6 +520,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Creates a new emoji for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#create-guild-emoji}
|
||||
* @param guildId - The id of the guild to create the emoji from
|
||||
* @param data - The data for creating the emoji
|
||||
* @param reason - The reason for creating the emoji
|
||||
@@ -499,6 +535,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits an emoji for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-guild-emoji}
|
||||
* @param guildId - The id of the guild to edit the emoji from
|
||||
* @param emojiId - The id of the emoji to edit
|
||||
* @param data - The data for editing the emoji
|
||||
@@ -519,6 +556,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Deletes an emoji for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#delete-guild-emoji}
|
||||
* @param guildId - The id of the guild to delete the emoji from
|
||||
* @param emojiId - The id of the emoji to delete
|
||||
* @param reason - The reason for deleting the emoji
|
||||
@@ -530,6 +568,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches all scheduled events for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild}
|
||||
* @param guildId - The id of the guild to fetch the scheduled events from
|
||||
* @param options - The options for fetching the scheduled events
|
||||
*/
|
||||
@@ -542,6 +581,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Creates a new scheduled event for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event}
|
||||
* @param guildId - The id of the guild to create the scheduled event from
|
||||
* @param data - The data to create the event with
|
||||
* @param reason - The reason for creating the scheduled event
|
||||
@@ -556,6 +596,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches a scheduled event for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event}
|
||||
* @param guildId - The id of the guild to fetch the scheduled event from
|
||||
* @param eventId - The id of the scheduled event to fetch
|
||||
* @param options - The options for fetching the scheduled event
|
||||
@@ -573,6 +614,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits a scheduled event for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
||||
* @param guildId - The id of the guild to edit the scheduled event from
|
||||
* @param eventId - The id of the scheduled event to edit
|
||||
* @param data - The new event data
|
||||
@@ -593,6 +635,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Deletes a scheduled event for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
|
||||
* @param guildId - The id of the guild to delete the scheduled event from
|
||||
* @param eventId - The id of the scheduled event to delete
|
||||
* @param reason - The reason for deleting the scheduled event
|
||||
@@ -604,6 +647,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Gets all users that are interested in a scheduled event
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users}
|
||||
* @param guildId - The id of the guild to fetch the scheduled event users from
|
||||
* @param eventId - The id of the scheduled event to fetch the users for
|
||||
* @param options - The options for fetching the scheduled event users
|
||||
@@ -621,6 +665,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches all the templates for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
|
||||
* @param guildId - The id of the guild to fetch the templates from
|
||||
*/
|
||||
public async getTemplates(guildId: Snowflake) {
|
||||
@@ -630,6 +675,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Syncs a template for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-template#sync-guild-template}
|
||||
* @param guildId - The id of the guild to sync the template from
|
||||
* @param templateCode - The code of the template to sync
|
||||
*/
|
||||
@@ -640,6 +686,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits a template for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-template#modify-guild-template}
|
||||
* @param guildId - The id of the guild to edit the template from
|
||||
* @param templateCode - The code of the template to edit
|
||||
* @param data - The data for editing the template
|
||||
@@ -653,6 +700,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Deletes a template for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-template#delete-guild-template}
|
||||
* @param guildId - The id of the guild to delete the template from
|
||||
* @param templateCode - The code of the template to delete
|
||||
*/
|
||||
@@ -663,6 +711,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches all the stickers for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
|
||||
* @param guildId - The id of the guild to fetch the stickers from
|
||||
*/
|
||||
public async getStickers(guildId: Snowflake) {
|
||||
@@ -672,6 +721,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches a sticker for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
|
||||
* @param guildId - The id of the guild to fetch the sticker from
|
||||
* @param stickerId - The id of the sticker to fetch
|
||||
*/
|
||||
@@ -682,6 +732,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Creates a sticker for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
|
||||
* @param guildId - The id of the guild to create the sticker for
|
||||
* @param data - The data for creating the sticker
|
||||
* @param reason - The reason for creating the sticker
|
||||
@@ -704,6 +755,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits a sticker for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
|
||||
* @param guildId - The id of the guild to edit the sticker from
|
||||
* @param stickerId - The id of the sticker to edit
|
||||
* @param data - The data for editing the sticker
|
||||
@@ -724,6 +776,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Deletes a sticker for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
|
||||
* @param guildId - The id of the guild to delete the sticker from
|
||||
* @param stickerId - The id of the sticker to delete
|
||||
* @param reason - The reason for deleting the sticker
|
||||
@@ -735,6 +788,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches the audit logs for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
|
||||
* @param guildId - The id of the guild to fetch the audit logs from
|
||||
* @param options - The options for fetching the audit logs
|
||||
*/
|
||||
@@ -747,6 +801,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches all auto moderation rules for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
|
||||
* @param guildId - The id of the guild to fetch the auto moderation rules from
|
||||
*/
|
||||
public async getAutoModerationRules(guildId: Snowflake) {
|
||||
@@ -756,6 +811,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches an auto moderation rule for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule}
|
||||
* @param guildId - The id of the guild to fetch the auto moderation rule from
|
||||
* @param ruleId - The id of the auto moderation rule to fetch
|
||||
*/
|
||||
@@ -768,6 +824,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Creates a new auto moderation rule for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule}
|
||||
* @param guildId - The id of the guild to create the auto moderation rule from
|
||||
* @param data - The data for creating the auto moderation rule
|
||||
*/
|
||||
@@ -785,6 +842,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits an auto moderation rule for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule}
|
||||
* @param guildId - The id of the guild to edit the auto moderation rule from
|
||||
* @param ruleId - The id of the auto moderation rule to edit
|
||||
* @param data - The data for editing the auto moderation rule
|
||||
@@ -805,6 +863,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Deletes an auto moderation rule for a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule}
|
||||
* @param guildId - The id of the guild to delete the auto moderation rule from
|
||||
* @param ruleId - The id of the auto moderation rule to delete
|
||||
* @param reason - The reason for deleting the auto moderation rule
|
||||
@@ -816,6 +875,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches a guild member
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
|
||||
* @param guildId - The id of the guild
|
||||
* @param userId - The id of the user
|
||||
*/
|
||||
@@ -826,6 +886,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Searches for guild members
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#search-guild-members}
|
||||
* @param guildId - The id of the guild to search in
|
||||
* @param query - The query to search for
|
||||
* @param limit - The maximum number of members to return
|
||||
@@ -839,6 +900,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Edits a guild member
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-member}
|
||||
* @param guildId - The id of the guild
|
||||
* @param userId - The id of the user
|
||||
* @param data - The data to use when editing the guild member
|
||||
@@ -859,6 +921,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Adds a role to a guild member
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#add-guild-member-role}
|
||||
* @param guildId - The id of the guild
|
||||
* @param userId - The id of the user
|
||||
* @param roleId - The id of the role
|
||||
@@ -871,6 +934,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Removes a role from a guild member
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member-role}
|
||||
* @param guildId - The id of the guild
|
||||
* @param userId - The id of the user
|
||||
* @param roleId - The id of the role
|
||||
@@ -883,6 +947,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Fetches a guild template
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-template}
|
||||
* @param templateCode - The code of the template
|
||||
*/
|
||||
public async getTemplate(templateCode: string) {
|
||||
@@ -892,6 +957,7 @@ export class GuildsAPI {
|
||||
/**
|
||||
* Creates a new template
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
|
||||
* @param templateCode - The code of the template
|
||||
* @param data - The data to use when creating the template
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,7 @@ export class InteractionsAPI {
|
||||
/**
|
||||
* Replies to an interaction
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
||||
* @param interactionId - The id of the interaction
|
||||
* @param interactionToken - The token of the interaction
|
||||
* @param data - The data to use when replying
|
||||
@@ -37,6 +38,7 @@ export class InteractionsAPI {
|
||||
/**
|
||||
* Defers the reply to an interaction
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
||||
* @param interactionId - The id of the interaction
|
||||
* @param interactionToken - The token of the interaction
|
||||
*/
|
||||
@@ -51,6 +53,7 @@ export class InteractionsAPI {
|
||||
/**
|
||||
* Defers an update from a message component interaction
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
||||
* @param interactionId - The id of the interaction
|
||||
* @param interactionToken - The token of the interaction
|
||||
*/
|
||||
@@ -65,6 +68,7 @@ export class InteractionsAPI {
|
||||
/**
|
||||
* Reply to a deferred interaction
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message}
|
||||
* @param applicationId - The application id of the interaction
|
||||
* @param interactionToken - The token of the interaction
|
||||
* @param data - The data to use when replying
|
||||
@@ -80,6 +84,8 @@ export class InteractionsAPI {
|
||||
/**
|
||||
* Edits the initial reply to an interaction
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response}
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message}
|
||||
* @param applicationId - The application id of the interaction
|
||||
* @param interactionToken - The token of the interaction
|
||||
* @param data - The data to use when editing the reply
|
||||
@@ -97,6 +103,7 @@ export class InteractionsAPI {
|
||||
/**
|
||||
* Fetches the initial reply to an interaction
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
|
||||
* @param applicationId - The application id of the interaction
|
||||
* @param interactionToken - The token of the interaction
|
||||
*/
|
||||
@@ -111,6 +118,8 @@ export class InteractionsAPI {
|
||||
/**
|
||||
* Deletes the initial reply to an interaction
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message}
|
||||
* @param applicationId - The application id of the interaction
|
||||
* @param interactionToken - The token of the interaction
|
||||
* @param messageId - The id of the message to delete. If omitted, the original reply will be deleted
|
||||
@@ -122,6 +131,7 @@ export class InteractionsAPI {
|
||||
/**
|
||||
* Updates the the message the component interaction was triggered on
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
||||
* @param interactionId - The id of the interaction
|
||||
* @param interactionToken - The token of the interaction
|
||||
* @param data - The data to use when updating the interaction
|
||||
@@ -143,6 +153,7 @@ export class InteractionsAPI {
|
||||
/**
|
||||
* Sends an autocomplete response to an interaction
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
||||
* @param interactionId - The id of the interaction
|
||||
* @param interactionToken - The token of the interaction
|
||||
* @param data - Data for the autocomplete response
|
||||
@@ -163,6 +174,7 @@ export class InteractionsAPI {
|
||||
/**
|
||||
* Sends a modal response to an interaction
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
||||
* @param interactionId - The id of the interaction
|
||||
* @param interactionToken - The token of the interaction
|
||||
* @param data - The modal to send
|
||||
|
||||
@@ -7,6 +7,7 @@ export class InvitesAPI {
|
||||
/**
|
||||
* Fetches an invite
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/invite#get-invite}
|
||||
* @param code - The invite code
|
||||
*/
|
||||
public async get(code: string, options: RESTGetAPIInviteQuery = {}) {
|
||||
@@ -18,6 +19,7 @@ export class InvitesAPI {
|
||||
/**
|
||||
* Deletes an invite
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/invite#delete-invite}
|
||||
* @param code - The invite code
|
||||
* @param reason - The reason for deleting the invite
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,8 @@ export class StickersAPI {
|
||||
|
||||
/**
|
||||
* Fetches all of the nitro sticker packs
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs}
|
||||
*/
|
||||
public async getNitroStickers() {
|
||||
return this.rest.get(Routes.nitroStickerPacks()) as Promise<RESTGetNitroStickerPacksResult>;
|
||||
@@ -19,6 +21,7 @@ export class StickersAPI {
|
||||
/**
|
||||
* Fetches a sticker
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
|
||||
* @param stickerId - The id of the sticker
|
||||
*/
|
||||
public async get(stickerId: Snowflake) {
|
||||
|
||||
@@ -24,6 +24,7 @@ export class ThreadsAPI {
|
||||
/**
|
||||
* Fetches a thread
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
|
||||
* @param threadId - The id of the thread
|
||||
*/
|
||||
public async get(threadId: Snowflake) {
|
||||
@@ -33,6 +34,8 @@ export class ThreadsAPI {
|
||||
/**
|
||||
* Creates a new thread
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message}
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
|
||||
* @param channelId - The id of the channel to start the thread in
|
||||
* @param data - The data to use when starting the thread
|
||||
*/
|
||||
@@ -43,6 +46,7 @@ export class ThreadsAPI {
|
||||
/**
|
||||
* Creates a new forum post
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel}
|
||||
* @param channelId - The id of the forum channel to start the thread in
|
||||
* @param data - The data to use when starting the thread
|
||||
*/
|
||||
@@ -60,6 +64,7 @@ export class ThreadsAPI {
|
||||
/**
|
||||
* Adds the current user to a thread
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
|
||||
* @param threadId - The id of the thread to join
|
||||
*/
|
||||
public async join(threadId: Snowflake) {
|
||||
@@ -69,6 +74,7 @@ export class ThreadsAPI {
|
||||
/**
|
||||
* Adds a member to a thread
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#add-thread-member}
|
||||
* @param threadId - The id of the thread to add the member to
|
||||
* @param userId - The id of the user to add to the thread
|
||||
*/
|
||||
@@ -79,6 +85,7 @@ export class ThreadsAPI {
|
||||
/**
|
||||
* Removes the current user from a thread
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#leave-thread}
|
||||
* @param threadId - The id of the thread to leave
|
||||
*/
|
||||
public async leave(threadId: Snowflake) {
|
||||
@@ -88,6 +95,7 @@ export class ThreadsAPI {
|
||||
/**
|
||||
* Removes a member from a thread
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#remove-thread-member}
|
||||
* @param threadId - The id of the thread to remove the member from
|
||||
* @param userId - The id of the user to remove from the thread
|
||||
*/
|
||||
@@ -98,6 +106,7 @@ export class ThreadsAPI {
|
||||
/**
|
||||
* Fetches a member of a thread
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#get-thread-member}
|
||||
* @param threadId - The id of the thread to fetch the member from
|
||||
* @param userId - The id of the user
|
||||
*/
|
||||
@@ -108,6 +117,7 @@ export class ThreadsAPI {
|
||||
/**
|
||||
* Fetches all members of a thread
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
|
||||
* @param threadId - The id of the thread to fetch the members from
|
||||
*/
|
||||
public async getAllMembers(threadId: Snowflake) {
|
||||
|
||||
@@ -22,6 +22,7 @@ export class UsersAPI {
|
||||
/**
|
||||
* Fetches a user by their id
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#get-user}
|
||||
* @param userId - The id of the user to fetch
|
||||
*/
|
||||
public async get(userId: Snowflake) {
|
||||
@@ -30,6 +31,8 @@ export class UsersAPI {
|
||||
|
||||
/**
|
||||
* Returns the user object of the requester's account
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#get-current-user}
|
||||
*/
|
||||
public async getCurrent() {
|
||||
return this.rest.get(Routes.user('@me')) as Promise<RESTGetAPICurrentUserResult>;
|
||||
@@ -38,6 +41,7 @@ export class UsersAPI {
|
||||
/**
|
||||
* Returns a list of partial guild objects the current user is a member of
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#get-current-user-guilds}
|
||||
* @param options - The options to use when fetching the current user's guilds
|
||||
*/
|
||||
public async getGuilds(options: RESTGetAPICurrentUserGuildsQuery = {}) {
|
||||
@@ -49,6 +53,7 @@ export class UsersAPI {
|
||||
/**
|
||||
* Leaves the guild with the given id
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#leave-guild}
|
||||
* @param guildId - The id of the guild
|
||||
*/
|
||||
public async leaveGuild(guildId: Snowflake) {
|
||||
@@ -58,6 +63,7 @@ export class UsersAPI {
|
||||
/**
|
||||
* Edits the current user
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#modify-current-user}
|
||||
* @param user - The new data for the current user
|
||||
*/
|
||||
public async edit(user: RESTPatchAPICurrentUserJSONBody) {
|
||||
@@ -67,6 +73,7 @@ export class UsersAPI {
|
||||
/**
|
||||
* Fetches the guild member for the current user
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#get-current-user-guild-member}
|
||||
* @param guildId - The id of the guild
|
||||
*/
|
||||
public async getGuildMember(guildId: Snowflake) {
|
||||
@@ -76,6 +83,7 @@ export class UsersAPI {
|
||||
/**
|
||||
* Edits the guild member for the current user
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-current-member}
|
||||
* @param guildId - The id of the guild
|
||||
* @param member - The new data for the guild member
|
||||
* @param reason - The reason for editing this guild member
|
||||
@@ -90,6 +98,7 @@ export class UsersAPI {
|
||||
/**
|
||||
* Sets the voice state for the current user
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
|
||||
* @param guildId - The id of the guild
|
||||
* @param options - The options to use when setting the voice state
|
||||
*/
|
||||
@@ -102,6 +111,7 @@ export class UsersAPI {
|
||||
/**
|
||||
* Opens a new DM channel with a user
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#create-dm}
|
||||
* @param userId - The id of the user to open a DM channel with
|
||||
*/
|
||||
public async createDM(userId: Snowflake) {
|
||||
|
||||
@@ -6,6 +6,8 @@ export class VoiceAPI {
|
||||
|
||||
/**
|
||||
* Fetches all voice regions
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
|
||||
*/
|
||||
public async getVoiceRegions() {
|
||||
return this.rest.get(Routes.voiceRegions()) as Promise<GetAPIVoiceRegionsResult>;
|
||||
|
||||
@@ -23,6 +23,8 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Fetches a webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
|
||||
* @param id - The id of the webhook
|
||||
* @param token - The token of the webhook
|
||||
*/
|
||||
@@ -33,6 +35,7 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Creates a new webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#create-webhook}
|
||||
* @param channelId - The id of the channel to create the webhook in
|
||||
* @param data - The data to use when creating the webhook
|
||||
* @param reason - The reason for creating the webhook
|
||||
@@ -47,6 +50,8 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Edits a webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook}
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
|
||||
* @param id - The id of the webhook to edit
|
||||
* @param webhook - The new webhook data
|
||||
* @param options - The options to use when editing the webhook
|
||||
@@ -62,6 +67,8 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Deletes a webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token}
|
||||
* @param id - The id of the webhook to delete
|
||||
* @param options - The options to use when deleting the webhook
|
||||
*/
|
||||
@@ -72,6 +79,7 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Executes a webhook and returns the created message
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
|
||||
* @param id - The id of the webhook
|
||||
* @param token - The token of the webhook
|
||||
* @param data - The data to use when executing the webhook
|
||||
@@ -85,6 +93,7 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Executes a webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
|
||||
* @param id - The id of the webhook
|
||||
* @param token - The token of the webhook
|
||||
* @param data - The data to use when executing the webhook
|
||||
@@ -98,6 +107,7 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Executes a webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
|
||||
* @param id - The id of the webhook
|
||||
* @param token - The token of the webhook
|
||||
* @param data - The data to use when executing the webhook
|
||||
@@ -124,6 +134,7 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Executes a slack webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook}
|
||||
* @param id - The id of the webhook
|
||||
* @param token - The token of the webhook
|
||||
* @param options - The options to use when executing the webhook
|
||||
@@ -144,6 +155,7 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Executes a github webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook}
|
||||
* @param id - The id of the webhook
|
||||
* @param token - The token of the webhook
|
||||
* @param options - The options to use when executing the webhook
|
||||
@@ -164,6 +176,7 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Fetches an associated message from a webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-message}
|
||||
* @param id - The id of the webhook
|
||||
* @param token - The token of the webhook
|
||||
* @param messageId - The id of the message to fetch
|
||||
@@ -179,6 +192,7 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Edits an associated message from a webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
|
||||
* @param id - The id of the webhook
|
||||
* @param token - The token of the webhook
|
||||
* @param messageId - The id of the message to edit
|
||||
@@ -200,6 +214,7 @@ export class WebhooksAPI {
|
||||
/**
|
||||
* Deletes an associated message from a webhook
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-message}
|
||||
* @param id - The id of the webhook
|
||||
* @param token - The token of the webhook
|
||||
* @param messageId - The id of the message to delete
|
||||
|
||||
Reference in New Issue
Block a user