GuildsAPI
No summary provided.
constructor(rest)
Constructs a new instance of the
GuildsAPI
className | Type | Optional | Description |
---|---|---|---|
rest | REST | No | None |
Adds a role to a guild member
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 |
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 |
Creates a guild
Name | Type | Optional | Description |
---|---|---|---|
data | RESTPostAPIGuildsJSONBody | No | The guild to create |
createAutoModerationRule(guildId, data, reason?):Promise<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 |
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 |
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 |
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 |
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 |
Creates a sticker for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to create the sticker for |
data | Omit<RESTPostAPIGuildStickerFormDataBody, 'file'> & { file: RawFile; } | No | The data for creating the sticker |
reason | string | Yes | The reason for creating the sticker |
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 |
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 |
Deletes an auto moderation rule for a guild
Deletes an emoji for a guild
Deletes an integration from a guild
Deletes a guild role
Deletes a scheduled event for a guild
Deletes a sticker for a guild
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 |
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 |
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 |
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 |
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 |
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<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 |
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 |
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 |
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 |
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 |
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 |
Fetches a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | string | No | The id of the guild |
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 |
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 |
Fetches an auto moderation rule for a guild
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 |
Fetches a guild's channels
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the channels from |
Fetches an emoji for a guild
Fetches all emojis for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the emojis from |
Fetches the integrations for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the integrations from |
Fetches the invites for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the invites from |
Fetches a guild member
Fetches a guild member ban
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the ban from |
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 |
Fetches a guild preview
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the preview from |
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 |
Gets all the roles in a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the roles from |
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 |
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 |
Fetches a sticker for a guild
Fetches all the stickers for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the stickers from |
Fetches a guild template
Name | Type | Optional | Description |
---|---|---|---|
templateCode | string | No | The code of the template |
Fetches all the templates for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the templates from |
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 |
Fetches voice regions for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the voice regions from |
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 |
Fetches the widget for a guild
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to fetch the widget from |
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 |
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 |
Removes a role from a guild member
Searches for guild members
Name | Type | Optional | Description |
---|---|---|---|
guildId | Snowflake | No | The id of the guild to search in |
query | RESTGetAPIGuildMembersSearchQuery | No | The query to search for |
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 |
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 |
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 |
Unbans a user from a guild