export declare class GuildsAPI
export declare class GuildsAPI
No summary provided.
constructor(rest)
Constructs a new instance of the
GuildsAPI
className | Type | Optional | Description |
---|---|---|---|
rest | REST | No | None |
addRoleToMember(guildId, userId, roleId, reason?)
:
Promise<void>
Adds a role to a guild member
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
userId | Snowflake | No | The id of the user |
roleId | Snowflake | No | The id of the role |
reason | string | Yes | The reason for adding this role to the guild member |
banUser(guildId, userId, options?, reason?)
:
Promise<void>
Bans a user from a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to ban the member in |
userId | Snowflake | No | The id of the user to ban |
options | RESTPutAPIGuildBanJSONBody | Yes | Options for banning the user |
reason | string | Yes | The reason for banning the user |
beginPrune(guildId, options?, reason?)
:
Promise<RESTGetAPIGuildPruneCountResult>
Prunes members in a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to prune members in |
options | RESTPostAPIGuildPruneJSONBody | Yes | The options for pruning members |
reason | string | Yes | The reason for pruning members |
create(data)
:
Promise<import("discord-api-types/v10").APIGuild>
Creates a guild
Name | Type | Optional | Description |
---|---|---|---|
data | RESTPostAPIGuildsJSONBody | No | The guild to create |
createAutoModerationRule(guildId, data, reason?)
:
Promise<import("discord-api-types/v10").APIAutoModerationRule>
Creates a new auto moderation rule for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to create the auto moderation rule from |
data | RESTPostAPIAutoModerationRuleJSONBody | No | The data for creating the auto moderation rule |
reason | string | Yes | None |
createChannel(guildId, data, reason?)
:
Promise<import("discord-api-types/v10").APIChannel>
Creates a guild channel
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to create the channel in |
data | RESTPostAPIGuildChannelJSONBody | No | The data to create the new channel |
reason | string | Yes | The reason for creating this channel |
createEmoji(guildId, data, reason?)
:
Promise<import("discord-api-types/v10").APIEmoji>
Creates a new emoji for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to create the emoji from |
data | RESTPostAPIGuildEmojiJSONBody | No | The data for creating the emoji |
reason | string | Yes | The reason for creating the emoji |
createRole(guildId, data, reason?)
:
Promise<import("discord-api-types/v10").APIRole>
Creates a guild role
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to create the role in |
data | RESTPostAPIGuildRoleJSONBody | No | The data to create the role with |
reason | string | Yes | The reason for creating the role |
createScheduledEvent(guildId, data, reason?)
:
Promise<import("discord-api-types/v10").APIGuildScheduledEvent>
Creates a new scheduled event for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to create the scheduled event from |
data | RESTPostAPIGuildScheduledEventJSONBody | No | The data to create the event with |
reason | string | Yes | The reason for creating the scheduled event |
createSticker(guildId, { file, ...body }, reason?)
:
Promise<import("discord-api-types/v10").APISticker>
Creates a sticker for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to create the sticker for |
{ file, ...body } | Omit<RESTPostAPIGuildStickerFormDataBody, 'file'> & { file: RawFile; } | No | None |
reason | string | Yes | The reason for creating the sticker |
createTemplate(templateCode, data)
:
Promise<import("discord-api-types/v10").APITemplate>
Creates a new template
Name | Type | Optional | Description |
---|---|---|---|
templateCode | string | No | The code of the template |
data | RESTPostAPITemplateCreateGuildJSONBody | No | The data to use when creating the template |
delete(guildId, reason?)
:
Promise<void>
Deletes a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to delete |
reason | string | Yes | The reason for deleting this guild |
deleteAutoModerationRule(guildId, ruleId, reason?)
:
Promise<void>
Deletes an auto moderation rule for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to delete the auto moderation rule from |
ruleId | Snowflake | No | The id of the auto moderation rule to delete |
reason | string | Yes | The reason for deleting the auto moderation rule |
deleteEmoji(guildId, emojiId, reason?)
:
Promise<void>
Deletes an emoji for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to delete the emoji from |
emojiId | Snowflake | No | The id of the emoji to delete |
reason | string | Yes | The reason for deleting the emoji |
deleteIntegration(guildId, integrationId, reason?)
:
Promise<void>
Deletes an integration from a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to delete the integration from |
integrationId | Snowflake | No | The id of the integration to delete |
reason | string | Yes | The reason for deleting the integration |
deleteRole(guildId, roleId, reason?)
:
Promise<void>
Deletes a guild role
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to delete the role in |
roleId | Snowflake | No | The id of the role to delete |
reason | string | Yes | The reason for deleting the role |
deleteScheduledEvent(guildId, eventId, reason?)
:
Promise<void>
Deletes a scheduled event for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to delete the scheduled event from |
eventId | Snowflake | No | The id of the scheduled event to delete |
reason | string | Yes | The reason for deleting the scheduled event |
deleteSticker(guildId, stickerId, reason?)
:
Promise<void>
Deletes a sticker for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to delete the sticker from |
stickerId | Snowflake | No | The id of the sticker to delete |
reason | string | Yes | The reason for deleting the sticker |
deleteTemplate(guildId, templateCode)
:
Promise<void>
Deletes a template for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to delete the template from |
templateCode | string | No | The code of the template to delete |
edit(guildId, data, reason?)
:
Promise<import("discord-api-types/v10").APIGuild>
Edits a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit |
data | RESTPatchAPIGuildJSONBody | No | The new guild data |
reason | string | Yes | The reason for editing this guild |
editAutoModerationRule(guildId, ruleId, data, reason?)
:
Promise<RESTPatchAPIAutoModerationRuleJSONBody>
Edits an auto moderation rule for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the auto moderation rule from |
ruleId | Snowflake | No | The id of the auto moderation rule to edit |
data | RESTPatchAPIAutoModerationRuleJSONBody | No | The data for editing the auto moderation rule |
reason | string | Yes | The reason for editing the auto moderation rule |
editEmoji(guildId, emojiId, data, reason?)
:
Promise<import("discord-api-types/v10").APIEmoji>
Edits an emoji for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the emoji from |
emojiId | Snowflake | No | The id of the emoji to edit |
data | RESTPatchAPIGuildEmojiJSONBody | No | The data for editing the emoji |
reason | string | Yes | The reason for editing the emoji |
editMember(guildId, userId, data?, reason?)
:
Promise<import("discord-api-types/v10").APIGuildMember>
Edits a guild member
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
userId | Snowflake | No | The id of the user |
data | RESTPatchAPIGuildMemberJSONBody | Yes | The data to use when editing the guild member |
reason | string | Yes | The reason for editing this guild member |
editMFALevel(guildId, level, reason?)
:
Promise<import("discord-api-types/v10").RESTPostAPIGuildsMFAJSONBody>
Edits the multi-factor-authentication (MFA) level of a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the MFA level for |
level | GuildMFALevel | No | The new MFA level |
reason | string | Yes | The reason for editing the MFA level |
editRole(guildId, roleId, data, reason?)
:
Promise<import("discord-api-types/v10").APIRole>
Edits a guild role
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the role in |
roleId | Snowflake | No | The id of the role to edit |
data | RESTPatchAPIGuildRoleJSONBody | No | data for editing the role |
reason | string | Yes | The reason for editing the role |
editScheduledEvent(guildId, eventId, data, reason?)
:
Promise<import("discord-api-types/v10").APIGuildScheduledEvent>
Edits a scheduled event for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the scheduled event from |
eventId | Snowflake | No | The id of the scheduled event to edit |
data | RESTPatchAPIGuildScheduledEventJSONBody | No | The new event data |
reason | string | Yes | The reason for editing the scheduled event |
editSticker(guildId, stickerId, data, reason?)
:
Promise<import("discord-api-types/v10").APISticker>
Edits a sticker for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the sticker from |
stickerId | Snowflake | No | The id of the sticker to edit |
data | RESTPatchAPIGuildStickerJSONBody | No | The data for editing the sticker |
reason | string | Yes | The reason for editing the sticker |
editTemplate(guildId, templateCode, data)
:
Promise<import("discord-api-types/v10").APITemplate>
Edits a template for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the template from |
templateCode | string | No | The code of the template to edit |
data | RESTPatchAPIGuildTemplateJSONBody | No | The data for editing the template |
editUserVoiceState(guildId, userId, data, reason?)
:
Promise<void>
Edits a user's voice state in a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the current user's voice state in |
userId | Snowflake | No | The id of the user to edit the voice state for |
data | RESTPatchAPIGuildVoiceStateUserJSONBody | No | The data for editing the voice state |
reason | string | Yes | The reason for editing the voice state |
editWelcomeScreen(guildId, data?, reason?)
:
Promise<import("discord-api-types/v10").APIGuildWelcomeScreen>
Edits the welcome screen for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the welcome screen for |
data | RESTPatchAPIGuildWelcomeScreenJSONBody | Yes | The new welcome screen data |
reason | string | Yes | The reason for editing the welcome screen |
editWidgetSettings(guildId, data, reason?)
:
Promise<import("discord-api-types/v10").APIGuildWidgetSettings>
Edits the widget settings for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the widget settings from |
data | RESTPatchAPIGuildWidgetSettingsJSONBody | No | The new widget settings data |
reason | string | Yes | The reason for editing the widget settings |
get(guildId)
:
Promise<import("discord-api-types/v10").APIGuild>
Fetches a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | string | No | The id of the guild |
getActiveThreads(guildId)
:
Promise<import("discord-api-types/v10").APIThreadList>
Fetches the active threads in a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the active threads from |
getAuditLogs(guildId, options?)
:
Promise<import("discord-api-types/v10").APIAuditLog>
Fetches the audit logs for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the audit logs from |
options | RESTGetAPIAuditLogQuery | Yes | The options for fetching the audit logs |
getAutoModerationRule(guildId, ruleId)
:
Promise<import("discord-api-types/v10").APIAutoModerationRule>
Fetches an auto moderation rule for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the auto moderation rule from |
ruleId | Snowflake | No | The id of the auto moderation rule to fetch |
getAutoModerationRules(guildId)
:
Promise<RESTGetAPIAutoModerationRulesResult>
Fetches all auto moderation rules for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the auto moderation rules from |
getChannels(guildId)
:
Promise<RESTGetAPIGuildChannelsResult>
Fetches a guild's channels
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the channels from |
getEmoji(guildId, emojiId)
:
Promise<import("discord-api-types/v10").APIEmoji>
Fetches an emoji for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the emoji from |
emojiId | Snowflake | No | The id of the emoji to fetch |
getEmojis(guildId)
:
Promise<RESTGetAPIGuildEmojisResult>
Fetches all emojis for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the emojis from |
getIntegrations(guildId)
:
Promise<RESTGetAPIGuildIntegrationsResult>
Fetches the integrations for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the integrations from |
getInvites(guildId)
:
Promise<RESTGetAPIGuildInvitesResult>
Fetches the invites for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the invites from |
getMember(guildId, userId)
:
Promise<import("discord-api-types/v10").APIGuildMember>
Fetches a guild member
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
userId | Snowflake | No | The id of the user |
getMemberBans(guildId)
:
Promise<RESTGetAPIGuildBansResult>
Fetches a guild member ban
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the ban from |
getMembers(guildId, options?)
:
Promise<RESTGetAPIGuildMembersResult>
Fetches all the members of a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
options | RESTGetAPIGuildMembersQuery | Yes | The options to use when fetching the guild members |
getPreview(guildId)
:
Promise<import("discord-api-types/v10").APIGuildPreview>
Fetches a guild preview
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the preview from |
getPruneCount(guildId, options?)
:
Promise<RESTGetAPIGuildPruneCountResult>
Fetch the number of members that can be pruned from a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the number of pruned members from |
options | RESTGetAPIGuildPruneCountQuery | Yes | The options for fetching the number of pruned members |
getRoles(guildId)
:
Promise<RESTGetAPIGuildRolesResult>
Gets all the roles in a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the roles from |
getScheduledEvent(guildId, eventId, options?)
:
Promise<import("discord-api-types/v10").APIGuildScheduledEvent>
Fetches a scheduled event for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the scheduled event from |
eventId | Snowflake | No | The id of the scheduled event to fetch |
options | RESTGetAPIGuildScheduledEventQuery | Yes | The options for fetching the scheduled event |
getScheduledEvents(guildId, options?)
:
Promise<RESTGetAPIGuildScheduledEventsResult>
Fetches all scheduled events for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the scheduled events from |
options | RESTGetAPIGuildScheduledEventsQuery | Yes | The options for fetching the scheduled events |
getScheduledEventUsers(guildId, eventId, options?)
:
Promise<RESTGetAPIGuildScheduledEventUsersResult>
Gets all users that are interested in a scheduled event
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the scheduled event users from |
eventId | Snowflake | No | The id of the scheduled event to fetch the users for |
options | RESTGetAPIGuildScheduledEventUsersQuery | Yes | The options for fetching the scheduled event users |
getSticker(guildId, stickerId)
:
Promise<import("discord-api-types/v10").APISticker>
Fetches a sticker for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the sticker from |
stickerId | Snowflake | No | The id of the sticker to fetch |
getStickers(guildId)
:
Promise<RESTGetAPIGuildStickersResult>
Fetches all the stickers for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the stickers from |
getTemplate(templateCode)
:
Promise<import("discord-api-types/v10").APITemplate>
Fetches a guild template
Name | Type | Optional | Description |
---|---|---|---|
templateCode | string | No | The code of the template |
getTemplates(guildId)
:
Promise<RESTGetAPIGuildTemplatesResult>
Fetches all the templates for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the templates from |
getVanityURL(guildId)
:
Promise<RESTGetAPIGuildVanityUrlResult>
Fetches the vanity url for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the vanity url from |
getVoiceRegions(guildId)
:
Promise<RESTGetAPIGuildVoiceRegionsResult>
Fetches voice regions for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the voice regions from |
getWebhooks(id)
:
Promise<RESTGetAPIGuildWebhooksResult>
Fetches webhooks for a guild
Name | Type | Optional | Description |
---|---|---|---|
id | Snowflake | No | The id of the guild |
getWelcomeScreen(guildId)
:
Promise<import("discord-api-types/v10").APIGuildWelcomeScreen>
Fetches the welcome screen for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the welcome screen from |
getWidget(guildId)
:
Promise<import("discord-api-types/v10").APIGuildWidget>
Fetches the widget for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the widget from |
getWidgetImage(guildId, style?)
:
Promise<ArrayBuffer>
Fetches the widget image for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the widget image from |
style | GuildWidgetStyle | Yes | The style of the widget image |
getWidgetSettings(guildId)
:
Promise<ArrayBuffer>
Fetches the widget settings for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the widget settings from |
removeRoleFromMember(guildId, userId, roleId, reason?)
:
Promise<void>
Removes a role from a guild member
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
userId | Snowflake | No | The id of the user |
roleId | Snowflake | No | The id of the role |
reason | string | Yes | The reason for removing this role from the guild member |
searchForMembers(guildId, options)
:
Promise<RESTGetAPIGuildMembersSearchResult>
Searches for guild members
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to search in |
options | RESTGetAPIGuildMembersSearchQuery | No | None |
setChannelPositions(guildId, data, reason?)
:
Promise<void>
Edits a guild channel's positions
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to edit the channel positions from |
data | RESTPatchAPIGuildChannelPositionsJSONBody | No | The data to edit the channel positions with |
reason | string | Yes | The reason for editing the channel positions |
setRolePositions(guildId, data, reason?)
:
Promise<RESTPatchAPIGuildRolePositionsResult>
Sets role positions in a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to set role positions for |
data | RESTPatchAPIGuildRolePositionsJSONBody | No | The data for setting a role position |
reason | string | Yes | The reason for setting the role position |
setVoiceState(guildId, options?)
:
Promise<never>
Sets the voice state for the current user
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild |
options | RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody | Yes | The options to use when setting the voice state |
syncTemplate(guildId, templateCode)
:
Promise<import("discord-api-types/v10").APITemplate>
Syncs a template for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to sync the template from |
templateCode | string | No | The code of the template to sync |
unbanUser(guildId, userId, reason?)
:
Promise<void>
Unbans a user from a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to unban the member in |
userId | Snowflake | No | The id of the user to unban |
reason | string | Yes | The reason for unbanning the user |