Add a member to a guild. Requires an access token with the guilds.join
scope.
Returns the newly added member upon success, or void if the member is already in the guild.
The ID of the guild.
The ID of the user to add.
The options for adding the member.
This method may cache its result. The result will not be cached if the guild is not cached.
Add a role to a member.
The ID of the guild.
The ID of the member.
The ID of the role to add.
Optional
reason: stringThe reason for adding the role.
This method does not cache its result.
Begin a prune.
The ID of the guild.
Optional
options: BeginPruneOptionsThe options for the prune.
This method does not cache its result.
Ban up to 200 members from a guild. This requires both the BAN_MEMBERS
and MANAGE_GUILD
permissions.
If no members were banned, a FAILED_TO_BAN_USERS will be returned.
The bot user is ignored.
The ID of the guild.
The options for banning.
Create a guild. This can only be used by bots in under 10 guilds.
The options for creating the guild.
This method does not cache its result.
Create an auto moderation rule for a guild.
The ID of the guild.
The options for creating the rule.
This method may cache its result. The result will not be cached if the guild is not cached.
Create a ban for a user.
The ID of the guild.
The ID of the user to ban.
Optional
options: CreateBanOptionsThe options for creating the ban.
This method does not cache its result.
Create a channel in a guild.
The ID of the guild.
The options for creating the channel.
This method may cache its result. The result will not be cached if the guild is not cached.
Create an emoji in a guild.
The ID of the guild.
The options for creating the emoji.
This method may cache its result. The result will not be cached if the guild is not cached.
Guild#emojis
Client#users (creator, if applicable)
Create a guild from a template. This can only be used by bots in less than 10 guilds.
Note: This does NOT add the guild to the client's cache.
The code of the template to use.
The options for creating the guild.
This method does not cache its result.
Create a role.
The ID of the guild.
Optional
options: CreateRoleOptionsThe options for creating the role.
This method may cache its result. The result will not be cached if the guild is not cached.
Create a scheduled event in a guild.
The ID of the guild.
The options for creating the scheduled event.
This method may cache its result. The result will not be cached if the guild is not cached.
Create a sticker.
The ID of the guild.
The options for creating the sticker.
This method may cache its result. The result will not be cached if the guild is not cached.
Guild#stickers
Client#users (creator, if applicable)
Create a guild template.
The ID of the guild to create a template from.
The options for creating the template.
Delete an auto moderation rule.
The ID of the guild.
The ID of the rule to delete.
Optional
reason: stringThe reason for deleting the rule.
This method does not cache its result.
Delete an integration.
The ID of the guild.
The ID of the integration.
Optional
reason: stringThe reason for deleting the integration.
This method does not cache its result.
Delete a scheduled event.
The ID of the guild.
The ID of the scheduled event.
Optional
reason: stringThe reason for deleting the scheduled event. Discord's docs do not explicitly state a reason can be provided, so it may not be used.
This method does not cache its result.
Edit a guild.
The ID of the guild.
The options for editing the guild.
This method may cache its result. The result will not be cached if the guild is not already cached.
Edit an existing auto moderation rule.
The ID of the guild.
The ID of the rule to edit.
The options for editing the rule.
This method may cache its result. The result will not be cached if the guild is not cached.
Edit the positions of channels in a guild.
The ID of the guild.
The channels to move. Unedited channels do not need to be specified.
This method does not cache its result.
Modify the current member in a guild.
The ID of the guild.
The options for editing the member.
This method may cache its result. The result will not be cached if the guild is not cached.
Edit the current member's voice state in a guild. channelID
is required, and the current member must already be in that channel. See Discord's docs for more information.
The ID of the guild.
The options for editing the voice state.
This method does not cache its result.
Edit an existing emoji.
The ID of the guild the emoji is in.
The options for editing the emoji.
This method may cache its result. The result will not be cached if the guild is not cached.
Edit the incident actions for a guild.
The ID of the guild.
The options for editing the incident actions.
This method does not cache its result.
Edit the mfa level of a guild. This can only be used by the guild owner.
The ID of the guild.
The options for editing the MFA level.
This method does not cache its result.
Edit a guild member. Use editCurrentMember if you wish to update the nick of this client using the CHANGE_NICKNAME
permission.
The ID of the guild.
The ID of the member.
The options for editing the member.
This method may cache its result. The result will not be cached if the guild is not cached.
Edit a guild's onboarding configuration.
The ID of the guild.
The options for editing the onboarding configuration.
This method does not cache its result.
Edit an existing role.
The ID of the guild.
The options for editing the role.
This method may cache its result. The result will not be cached if the guild is not cached.
Edit the position of roles in a guild.
The ID of the guild.
The roles to move.
Optional
reason: stringThis method may cache its result. The result will not be cached if the guild is not cached.
Edit an existing scheduled event in a guild.
The ID of the guild.
The options for editing the scheduled event.
This method may cache its result. The result will not be cached if the guild is not cached.
Edit a sticker.
The ID of the guild.
The options for editing the sticker.
This method may cache its result. The result will not be cached if the guild is not cached.
Edit a guild template.
The ID of the guild.
The code of the template.
The options for editing the template.
This method does not cache its result.
Edit a guild member's voice state. channelID
is required, and the user must already be in that channel. See Discord's docs for more information.
The ID of the guild.
The ID of the member.
The options for editing the voice state.
This method does not cache its result.
Edit the welcome screen in a guild.
The ID of the guild.
The options for editing the welcome screen.
This method does not cache its result.
Edit the widget of a guild.
The ID of the guild.
The options for editing the widget.
This method does not cache its result.
Get a guild.
The ID of the guild.
Optional
withCounts: booleanIf the approximate number of members and online members should be included.
This method may cache its result. The result will not be cached if the guild is not already cached.
Get the active threads in a guild.
The ID of the guild.
This method may cache its result. The result will not be cached if the guild is not cached.
Get a guild's audit log.
The ID of the guild.
Optional
options: GetAuditLogOptionsThe options for getting the audit logs.
This method may cache its result. The result will not be cached if the guild is not cached.
Guild#autoModerationRules
Guild#scheduledEvents
Guild#integrations
Guild#threads
Client#users
Get an auto moderation rule for a guild.
The ID of the guild.
The ID of the rule to get.
This method may cache its result. The result will not be cached if the guild is not cached.
Get the auto moderation rules for a guild.
The ID of the guild.
This method may cache its result. The result will not be cached if the guild is not cached.
Get the bans in a guild.
The ID of the guild.
Optional
options: GetBansOptionsThe options for getting the bans.
Get the channels in a guild. Does not include threads.
The ID of the guild.
This method may cache its result. The result will not be cached if the guild is not cached.
Get an emoji in a guild.
The ID of the guild.
The ID of the emoji to get.
This method may cache its result. The result will not be cached if the guild is not cached.
Get the emojis in a guild.
The ID of the guild.
This method may cache its result. The result will not be cached if the guild is not cached.
Guild#emojis (will be completely cleared and refilled)
Get the integrations in a guild.
The ID of the guild.
This method may cache its result. The result will not be cached if the guild is not cached.
Get the invites of a guild.
The ID of the guild to get the invites of.
This method may cache its result. The result will not be cached if the guild is not cached.
Get a guild's members. This requires the GUILD_MEMBERS
intent.
The ID of the guild.
Optional
options: GetMembersOptionsThe options for getting the members.
This method may cache its result. The result will not be cached if the guild is not cached.
Get a guild's onboarding info.
The ID of the guild.
This method does not cache its result.
Get a preview of a guild. If the client is not already in this guild, the guild must be lurkable.
The ID of the guild.
This method does not cache its result.
Get the prune count of a guild.
The ID of the guild.
Optional
options: GetPruneCountOptionsThe options for getting the prune count.
This method does not cache its result.
Get a scheduled event.
The ID of the guild.
The ID of the scheduled event to get.
Optional
withUserCount: numberIf the number of users subscribed to the event should be included.
This method may cache its result. The result will not be cached if the guild is not cached.
Get the users subscribed to a scheduled event.
The ID of the guild.
The ID of the scheduled event.
Optional
options: GetScheduledEventUsersOptionsThe options for getting the users.
This method does cache part its result. Members will not be cached if the guild is not cached.
Get a guild's scheduled events.
The ID of the guild.
Optional
withUserCount: numberIf the number of users subscribed to the event should be included.
This method may cache its result. The result will not be cached if the guild is not cached.
Get a sticker. Response will include a user if the client has the MANAGE_EMOJIS_AND_STICKERS
permissions.
The ID of the guild.
The ID of the sticker to get.
This method may cache its result. The result will not be cached if the guild is not cached.
Get a guild's stickers. Stickers will include a user if the client has the MANAGE_EMOJIS_AND_STICKERS
permissions.
The ID of the guild.
This method may cache its result. The result will not be cached if the guild is not cached.
Guild#stickers (will be completely cleared and refilled)
Get a guild template.
The code of the template to get.
This method does not cache its result.
Get a guild's templates.
The ID of the guild.
This method does not cache its result.
Get the vanity url of a guild.
The ID of the guild.
This method does not cache its result.
Get the list of usable voice regions for a guild. This will return VIP servers when the guild is VIP-enabled.
The ID of the guild.
This method does not cache its result.
Get the welcome screen for a guild.
The ID of the guild.
This method does not cache its result.
Get the widget image of a guild.
The ID of the guild.
Optional
style: WidgetImageStyleThe style of the image.
This method does not cache its result.
Get a guild's widget settings.
The ID of the guild.
This method does not cache its result.
Remove a role from a member.
The ID of the guild.
The ID of the member.
The ID of the role to remove.
Optional
reason: stringThe reason for removing the role.
This method does not cache its result.
Search the username & nicknames of members in a guild.
The ID of the guild.
The options to search with.
This method may cache its result. The result will not be cached if the guild is not cached.
Sync a guild template.
The ID of the guild.
The code of the template to sync.
This method does not cache its result.
Various methods for interacting with guilds. Located at Client#rest.guilds.