Constructor
new Guild()
Properties:
| Name | Type | Attributes | Description | |||||
|---|---|---|---|---|---|---|---|---|
afkChannelID |
String
|
<nullable> |
The ID of the AFK voice channel |
|||||
afkTimeout |
Number
|
The AFK timeout in seconds |
||||||
applicationID |
String
|
<nullable> |
The application ID of the guild creator if it is bot-created |
|||||
approximateMemberCount |
Number
|
<nullable> |
The approximate number of members in the guild (REST only) |
|||||
approximatePresenceCount |
Number
|
<nullable> |
The approximate number of presences in the guild (REST only) |
|||||
autoRemoved |
Boolean
|
<nullable> |
Whether the guild was automatically removed from Discovery |
|||||
banner |
String
|
<nullable> |
The hash of the guild banner image, or null if no banner (VIP only) |
|||||
bannerURL |
String
|
<nullable> |
The URL of the guild's banner image |
|||||
categories |
Array.<Object>
|
<nullable> |
The guild's discovery categories |
|||||
channels |
Collection.<GuildChannel>
|
Collection of Channels in the guild |
||||||
createdAt |
Number
|
Timestamp of the guild's creation |
||||||
defaultNotifications |
Number
|
The default notification settings for the guild. 0 is "All Messages", 1 is "Only @mentions" |
||||||
description |
String
|
<nullable> |
The description for the guild (VIP only) |
|||||
discoverySplash |
String
|
<nullable> |
The has of the guild discovery splash image, or null if no discovery splash |
|||||
discoverySplashURL |
String
|
<nullable> |
The URL of the guild's discovery splash image |
|||||
emojiCount |
Number
|
<nullable> |
The number of emojis in the guild |
|||||
emojis |
Array.<Object>
|
An array of guild emoji objects |
||||||
explicitContentFilter |
Number
|
The explicit content filter level for the guild. 0 is off, 1 is on for people without roles, 2 is on for all |
||||||
features |
Array.<String>
|
An array of guild feature strings |
||||||
icon |
String
|
<nullable> |
The hash of the guild icon, or null if no icon |
|||||
iconURL |
String
|
<nullable> |
The URL of the guild's icon |
|||||
id |
String
|
The ID of the guild |
||||||
joinedAt |
Number
|
Timestamp of when the bot account joined the guild |
||||||
keywords |
Array.<String>
|
<nullable> |
The guild's discovery keywords |
|||||
large |
Boolean
|
Whether the guild is "large" by "some Discord standard" |
||||||
mfaLevel |
Number
|
The admin 2FA level for the guild. 0 is not required, 1 is required |
||||||
maxMembers |
Number
|
<nullable> |
The maximum amount of members for the guild |
|||||
maxPresences |
Number
|
The maximum number of people that can be online in a guild at once (returned from REST API only) |
||||||
maxStageVideoChannelUsers |
Number
|
<nullable> |
The max number of users allowed in a stage video channel |
|||||
maxVideoChannelUsers |
Number
|
<nullable> |
The max number of users allowed in a video channel |
|||||
memberCount |
Number
|
Number of members in the guild |
||||||
members |
Collection.<Member>
|
Collection of Members in the guild |
||||||
name |
String
|
The name of the guild |
||||||
nsfw |
Boolean
|
[DEPRECATED] Whether the guild is designated as NSFW by Discord |
||||||
nsfwLevel |
Number
|
The guild NSFW level designated by Discord |
||||||
ownerID |
String
|
The ID of the user that is the guild owner |
||||||
preferredLocale |
String
|
Preferred "COMMUNITY" guild language used in server discovery and notices from Discord |
||||||
premiumProgressBarEnabled |
Boolean
|
If the boost progress bar is enabled |
||||||
premiumSubscriptionCount |
Number
|
<nullable> |
The total number of users currently boosting this guild |
|||||
premiumTier |
Number
|
Nitro boost level of the guild |
||||||
primaryCategory |
Object
|
<nullable> |
The guild's primary discovery category |
|||||
primaryCategoryID |
Number
|
<nullable> |
The guild's primary discovery category ID |
|||||
publicUpdatesChannelID |
String
|
<nullable> |
ID of the guild's updates channel if the guild has "COMMUNITY" features |
|||||
roles |
Collection.<Role>
|
Collection of Roles in the guild |
||||||
rulesChannelID |
String
|
<nullable> |
The channel where "COMMUNITY" guilds display rules and/or guidelines |
|||||
safetyAlertsChannelID |
String
|
<nullable> |
The channel ID where admins and moderators of Community guilds receive safety alerts from Discord |
|||||
shard |
Shard
|
The Shard that owns the guild |
||||||
soundboardSounds |
Collection.<SoundboardSound>
|
Collection of Soundboard Sounds in the guild |
||||||
splash |
String
|
<nullable> |
The hash of the guild splash image, or null if no splash (VIP only) |
|||||
splashURL |
String
|
<nullable> |
The URL of the guild's splash image |
|||||
stageInstances |
Collection.<StageInstance>
|
Collection of stage instances in the guild |
||||||
stickers |
Array.<Object>
|
<nullable> |
An array of guild sticker objects |
|||||
systemChannelFlags |
Number
|
The flags for the system channel |
||||||
systemChannelID |
String
|
<nullable> |
The ID of the default channel for system messages (built-in join messages and boost messages) |
|||||
threads |
Collection.<ThreadChannel>
|
Collection of threads that the current user has permission to view |
||||||
unavailable |
Boolean
|
Whether the guild is unavailable or not |
||||||
vanityURL |
String
|
<nullable> |
The vanity URL of the guild (VIP only) |
|||||
verificationLevel |
Number
|
The guild verification level |
||||||
voiceStates |
Collection.<VoiceState>
|
Collection of voice states in the guild |
||||||
welcomeScreen |
Object
|
<nullable> |
The welcome screen of a Community guild, shown to new members |
|||||
| Name | Type | Description |
|---|---|---|
description |
Object
|
The description in the welcome screen |
welcomeChannels |
Array.<Object>
|
The list of channels in the welcome screens. Each channels have the following properties: |
widgetChannelIDNumber
The channel id that the widget will generate an invite to. REST only.
widgetEnabledBoolean
Whether the guild widget is enabled. REST only.
- Source:
Methods
addDiscoverySubcategory(categoryID, reasonopt) → {Promise.<Object>}
Add a discovery subcategory
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
categoryID |
String
|
The ID of the discovery category |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Object>
addMember(userID, accessToken, optionsopt)
Add a user to the guild
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userID |
String
|
The ID of the user |
|||||||||||||||||||||
accessToken |
String
|
The access token of the user |
|||||||||||||||||||||
options |
Object
|
<optional> |
Options for adding the user
|
addMemberRole(memberID, roleID, reasonopt) → {Promise}
Add a role to a guild member
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
memberID |
String
|
The ID of the member |
|
roleID |
String
|
The ID of the role |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
banMember(userID, reasonopt) → {Promise}
Ban a user from the guild
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
userID |
String
|
The ID of the member |
||
options.deleteMessageDays |
Number
|
<optional> |
0 |
[DEPRECATED] Number of days to delete messages for, between 0-7 inclusive |
options.deleteMessageSeconds |
Number
|
<optional> |
0 |
Number of seconds to delete messages for, between 0 and 604,800 inclusive |
options.reason |
String
|
<optional> |
The reason to be displayed in audit logs |
|
reason |
String
|
<optional> |
[DEPRECATED] The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
bulkBanMembers(options) → {Promise.<Object>}
Bulk ban users from the guild - Note: Requires both BAN_MEMBERS and MANAGE_GUILD permissions
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Options for banning the users
|
Returns:
- Type:
-
Promise.<Object>
An object with 2 arrays - banned_users with the IDs of the successfully banned users, and failed_users with the IDs of any users who could not be banned or were already banned
bulkEditCommands(commands) → {Promise.<Array.<ApplicationCommand>>}
Bulk create/edit the guild application commands
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
commands |
Array.<Object>
|
An array of command objects |
||
|
||||
commands[].defaultPermission |
Boolean
|
<optional> |
true |
[DEPRECATED] Whether the command is enabled by default when the application is added to a guild. Replaced by |
commands[].description |
String
|
<optional> |
The command description, required for |
|
commands[].descriptionLocalizations |
Object
|
<optional> <nullable> |
Localization directory with keys in available locales for the command description |
|
commands[].id |
String
|
<optional> |
The command ID, if known |
|
commands[].name |
String
|
The command name |
||
commands[].nameLocalizations |
Object
|
<optional> <nullable> |
Localization directory with keys in available locales for the command name |
|
commands[].nsfw |
Boolean
|
<optional> |
false |
Whether the command is age-restricted |
commands[].options |
Array.<Object>
|
<optional> |
The application command options |
|
commands[].type |
Number
|
<optional> |
1 |
The command type, either |
Returns:
- Type:
-
Promise.<Array.<ApplicationCommand>>
Resolves with the overwritten application commands
createAutoModerationRule(options) → {Promise.<AutoModerationRule>}
Create an auto moderation rule
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The rule to create
|
Returns:
- Type:
-
Promise.<AutoModerationRule>
createChannel(name, typeopt, optionsopt) → {Promise.<(CategoryChannel|ForumChannel|TextChannel|VoiceChannel)>}
Create a channel in the guild
- Source:
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
String
|
The name of the channel |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type |
Number
|
<optional> |
0 |
The type of the channel, either 0 (text), 2 (voice), 4 (category), 5 (news), 13 (stage), or 15 (forum) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object
|
String
|
<optional> |
The properties the channel should have. If
|
Returns:
- Type:
-
Promise.<(CategoryChannel|ForumChannel|TextChannel|VoiceChannel)>
createCommand(command) → {Promise.<ApplicationCommand>}
Create a guild application command
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
command |
Object
|
A command object |
||
|
||||
command.defaultPermission |
Boolean
|
<optional> |
true |
[DEPRECATED] Whether the command is enabled by default when the application is added to a guild. Replaced by |
command.description |
String
|
<optional> |
The command description, required for |
|
command.descriptionLocalizations |
Object
|
<optional> <nullable> |
Localization directory with keys in available locales for the command description |
|
command.name |
String
|
The command name |
||
command.nameLocalizations |
Object
|
<optional> <nullable> |
Localization directory with keys in available locales for the command name |
|
command.nsfw |
Boolean
|
<optional> |
false |
Whether the command is age-restricted |
command.options |
Array.<Object>
|
<optional> |
The application command options |
|
command.type |
Number
|
<optional> |
1 |
The command type, either |
createEmoji(options, reasonopt) → {Promise.<Object>}
Create a emoji in the guild
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Emoji options
|
|||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Object>
A guild emoji object
createRole(optionsopt, reasonopt) → {Promise.<Role>}
Create a guild role
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Role
|
<optional> |
An object or Role containing the properties to set
|
||||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Role>
createScheduledEvent(event, reasonopt) → {Promise.<GuildScheduledEvent>}
Create a guild scheduled event
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Object
|
The event to be created
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<GuildScheduledEvent>
createSoundboardSound(sound, reasonopt) → {Promise.<SoundboardSound>}
Create a guild soundboard sound
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sound |
Object
|
The sound to be created
|
|||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<SoundboardSound>
createSticker(options, reasonopt) → {Promise.<Object>}
Create a guild sticker
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Sticker options
|
||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Object>
A sticker object
createTemplate(name, descriptionopt) → {Promise.<GuildTemplate>}
Create a template for this guild
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
String
|
The name of the template |
|
description |
String
|
<optional> |
The description for the template |
Returns:
- Type:
-
Promise.<GuildTemplate>
deleteAutoModerationRule(ruleID, reasonopt) → {Promise}
Delete an auto moderation rule
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
ruleID |
String
|
The ID of the rule to delete |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
deleteCommand(commandID) → {Promise}
Delete a guild application command
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
commandID |
String
|
The command id |
Returns:
- Type:
-
Promise
Resolves with a promise object
deleteDiscoverySubcategory(categoryID, reasonopt) → {Promise}
Delete a discovery subcategory
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
categoryID |
String
|
The ID of the discovery category |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
deleteEmoji(emojiID, reasonopt) → {Promise}
Delete a emoji in the guild
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
emojiID |
String
|
The ID of the emoji |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
deleteIntegration(integrationID) → {Promise}
Delete a guild integration
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
integrationID |
String
|
The ID of the integration |
Returns:
- Type:
-
Promise
deleteRole(roleID, reasonopt) → {Promise}
Delete a role
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
roleID |
String
|
The ID of the role |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
deleteScheduledEvent(eventID) → {Promise}
Delete a guild scheduled event
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
eventID |
String
|
The ID of the event |
Returns:
- Type:
-
Promise
deleteSoundboardSound(soundID, reasonopt) → {Promise}
Delete a guild soundboard sound
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
soundID |
String
|
The ID of the soundboard sound |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
deleteSticker(stickerID, reasonopt) → {Promise}
Delete a guild sticker
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
stickerID |
String
|
The ID of the sticker |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
deleteTemplate(code) → {Promise.<GuildTemplate>}
Delete a guild template
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
code |
String
|
The template code |
Returns:
- Type:
-
Promise.<GuildTemplate>
dynamicBannerURL(formatopt, sizeopt) → (nullable) {String}
Get the guild's banner with the given format and size
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
format |
String
|
<optional> |
The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp") |
size |
Number
|
<optional> |
The size of the icon (any power of two between 16 and 4096) |
Returns:
- Type:
-
String
dynamicDiscoverySplashURL(formatopt, sizeopt) → (nullable) {String}
Get the guild's discovery splash with the given format and size
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
format |
String
|
<optional> |
The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp") |
size |
Number
|
<optional> |
The size of the icon (any power of two between 16 and 4096) |
Returns:
- Type:
-
String
dynamicIconURL(formatopt, sizeopt) → (nullable) {String}
Get the guild's icon with the given format and size
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
format |
String
|
<optional> |
The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp") |
size |
Number
|
<optional> |
The size of the icon (any power of two between 16 and 4096) |
Returns:
- Type:
-
String
dynamicSplashURL(formatopt, sizeopt) → (nullable) {String}
Get the guild's splash with the given format and size
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
format |
String
|
<optional> |
The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp") |
size |
Number
|
<optional> |
The size of the icon (any power of two between 16 and 4096) |
Returns:
- Type:
-
String
edit(options, reasonopt) → {Promise.<Guild>}
Edit the guild
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The properties to edit
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Guild>
editAutoModerationRule(ruleID, options) → {Promise.<AutoModerationRule>}
Edit an existing auto moderation rule
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ruleID |
String
|
The ID of the rule to edit |
||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object
|
The properties to edit
|
Returns:
- Type:
-
Promise.<AutoModerationRule>
editChannelPositions(channelPositions) → {Promise}
Edit multiple channels' positions. Note that channel position numbers are grouped by type (category, text, voice), then sorted in ascending order (lowest number is on top).
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelPositions |
Array.<Object>
|
An array of ChannelPosition
|
Returns:
- Type:
-
Promise
editCommand(commandID, command) → {Promise.<ApplicationCommand>}
Edit a guild application command
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
commandID |
String
|
The command ID |
|
command |
Object
|
A command object |
|
|
|||
command.defaultPermission |
Boolean
|
<optional> |
[DEPRECATED] Whether the command is enabled by default when the application is added to a guild. Replaced by |
command.description |
String
|
<optional> |
The command description, required for |
command.descriptionLocalizations |
Object
|
<optional> <nullable> |
Localization directory with keys in available locales for the command description |
command.name |
String
|
<optional> |
The command name |
command.nameLocalizations |
Object
|
<optional> <nullable> |
Localization directory with keys in available locales for the command name |
command.nsfw |
Boolean
|
<optional> |
Whether the command is age-restricted |
command.options |
Array.<Object>
|
<optional> |
The application command options |
editCommandPermissions(commandID, permissions, reasonopt) → {Promise.<Object>}
Edits command permissions for a specific command in a guild. Note: You can only add up to 10 permission overwrites for a command.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
commandID |
String
|
The command id |
|
permissions |
Array.<Object>
|
An array of permissions objects |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
editDiscovery(optionsopt) → {Promise.<Object>}
Edit the guild's discovery data
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
The guild discovery data
|
Returns:
- Type:
-
Promise.<Object>
The updated discovery object
editEmoji(emojiID, options, reasonopt) → {Promise.<Object>}
Edit a emoji in the guild
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
emojiID |
String
|
The ID of the emoji you want to modify |
|||||||||||||
options |
Object
|
Emoji options
|
|||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Object>
A guild emoji object
editMember(memberID, options, reasonopt) → {Promise.<Member>}
Edit a guild member
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
memberID |
String
|
The ID of the member (use "@me" to edit the current bot user) |
|||||||||||||||||||||||||||||||||
options |
Object
|
The properties to edit
|
|||||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Member>
editNickname(nick) → {Promise}
[DEPRECATED] Edit the bot's nickname in the guild
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
nick |
String
|
The nickname |
Returns:
- Type:
-
Promise
editOnboarding(options, reasonopt) → {Promise.<Object>}
Edit the guild's onboarding settings
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The properties to edit
|
||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
editRole(roleID, options, reasonopt) → {Promise.<Role>}
Edit the guild role
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
roleID |
String
|
The ID of the role |
|||||||||||||||||||||||||||||||||
options |
Object
|
The properties to edit
|
|||||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Role>
editScheduledEvent(eventID, event, reasonopt) → {Promise.<GuildScheduledEvent>}
Edit this scheduled event
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eventID |
String
|
The guild scheduled event ID |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event |
Object
|
The new guild scheduled event object
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<GuildScheduledEvent>
editSticker(stickerID, options, reasonopt) → {Promise.<Object>}
Edit a guild sticker
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
stickerID |
String
|
The ID of the sticker |
|||||||||||||||||
options |
Object
|
The properties to edit
|
|||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Object>
A sticker object
editTemplate(code, options) → {Promise.<GuildTemplate>}
Edit a guild template
- Source:
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code |
String
|
The template code |
||||||||||||
options |
Object
|
The properties to edit
|
Returns:
- Type:
-
Promise.<GuildTemplate>
editVanity(codenullable) → {Promise.<Object>}
Modify the guild's vanity code
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
code |
String
|
<nullable> |
The new vanity code |
Returns:
- Type:
-
Promise.<Object>
editVoiceState(options, userIDopt) → {Promise}
Update a user's voice state - See caveats
- Source:
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The properties to edit
|
||||||||||||||||||
userID |
String
|
<optional> |
"@me" |
The user ID of the user to update |
Returns:
- Type:
-
Promise
editWelcomeScreen(optionsopt) → {Promise.<Object>}
Edit the guild welcome screen
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
The properties to edit
|
Returns:
- Type:
-
Promise.<Object>
editWidget(options) → {Promise.<Object>}
Modify a guild's widget
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The widget object to modify (https://discord.com/developers/docs/resources/guild#modify-guild-widget)
|
Returns:
- Type:
-
Promise.<Object>
A guild widget object
fetchAllMembers(timeoutopt) → {Promise.<Number>}
Request all guild members from Discord
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
timeout |
Number
|
<optional> |
The number of milliseconds to wait before resolving early. Defaults to the |
Returns:
- Type:
-
Promise.<Number>
Resolves with the total number of fetched members.
fetchMembers(optionsopt) → {Promise.<Array.<Member>>}
Request specific guild members through the gateway connection
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Options for fetching the members
|
fetchSoundboardSounds(options) → {Promise.<Array.<SoundboardSound>>}
Request the guild's soundboard sounds through the gateway connection
- Source:
Parameters:
| Name | Type | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Options for fetching the soundboard sounds
|
getActiveThreads() → {Promise.<Object>}
Get all active threads in this guild
- Source:
Returns:
- Type:
-
Promise.<Object>
An object containing an array of threads and an array of members
getAuditLog(optionsopt) → {Promise.<{entries: Array.<GuildAuditLogEntry>, integrations: Array.<PartialIntegration>, threads: Array.<(NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel)>, users: Array.<User>, webhooks: Array.<Webhook>}>}
Get the audit log for the guild
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as
|
Returns:
- Type:
-
Promise.<{entries: Array.<GuildAuditLogEntry>, integrations: Array.<PartialIntegration>, threads: Array.<(NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel)>, users: Array.<User>, webhooks: Array.<Webhook>}>
getAuditLogs(limitopt, beforeopt, actionTypeopt, userIDopt) → {Promise.<{entries: Array.<GuildAuditLogEntry>, integrations: Array.<PartialIntegration>, threads: Array.<(NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel)>, users: Array.<User>, webhooks: Array.<Webhook>}>}
[DEPRECATED] Get the audit log for a guild. Use getAuditLog instead
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
limit |
Number
|
<optional> |
50 |
The maximum number of entries to return |
before |
String
|
<optional> |
Get entries before this entry ID |
|
actionType |
Number
|
<optional> |
Filter entries by action type |
|
userID |
String
|
<optional> |
Filter entries by the user that performed the action |
Returns:
- Type:
-
Promise.<{entries: Array.<GuildAuditLogEntry>, integrations: Array.<PartialIntegration>, threads: Array.<(NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel)>, users: Array.<User>, webhooks: Array.<Webhook>}>
getAutoModerationRule(guildID, ruleID) → {Promise.<AutoModerationRule>}
Get an existing auto moderation rule
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
guildID |
String
|
The ID of the guild to get the rule from |
ruleID |
String
|
The ID of the rule to get |
Returns:
- Type:
-
Promise.<AutoModerationRule>
getAutoModerationRules(guildID) → {Promise.<Array.<AutoModerationRule>>}
Get a guild's auto moderation rules
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
guildID |
String
|
The ID of the guild to get the rules of |
Returns:
- Type:
-
Promise.<Array.<AutoModerationRule>>
getBan(userID) → {Promise.<Object>}
Get a ban from the ban list of a guild
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
userID |
String
|
The ID of the banned user |
Returns:
- Type:
-
Promise.<Object>
Resolves with {reason: String, user: User}
getBans(optionsopt) → {Promise.<Array.<Object>>}
Get the ban list of the guild
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Options for the request
|
Returns:
- Type:
-
Promise.<Array.<Object>>
Resolves with an array of { reason: String, user: User }
getCommand(commandID) → {Promise.<Object>}
Get a guild application command
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
commandID |
String
|
The command id |
Returns:
- Type:
-
Promise.<Object>
Resolves with a command object
getCommandPermissions(commandID) → {Promise.<Object>}
Get the a guild's application command permissions
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
commandID |
String
|
The command id |
Returns:
- Type:
-
Promise.<Object>
Resolves with a guild application command permissions object.
getCommands() → {Promise.<Array.<Object>>}
Get the guild's application commands
- Source:
Returns:
- Type:
-
Promise.<Array.<Object>>
Resolves with an array of command objects
getDiscovery() → {Promise.<Object>}
Get the guild's discovery object
- Source:
Returns:
- Type:
-
Promise.<Object>
getGuildCommandPermissions() → {Promise.<Array.<Object>>}
Get the all of a guild's application command permissions
- Source:
Returns:
- Type:
-
Promise.<Array.<Object>>
Resolves with an array of guild application command permissions objects.
getIntegrations() → {Promise.<Array.<GuildIntegration>>}
Get a list of integrations for the guild
- Source:
Returns:
- Type:
-
Promise.<Array.<GuildIntegration>>
getInvites() → {Promise.<Array.<Invite>>}
Get all invites in the guild
- Source:
Returns:
- Type:
-
Promise.<Array.<Invite>>
getOnboarding() → {Promise.<Object>}
Get the guild's onboarding settings
- Source:
getPruneCount(optionsopt) → {Promise.<Number>}
Get the prune count for the guild
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Number
|
<optional> |
The options to use to get number of prune members
|
Returns:
- Type:
-
Promise.<Number>
Resolves with the number of members that would be pruned
getRESTChannels() → {Promise.<(Array.<(CategoryChannel|ForumChannel|NewsChannel|StageChannel|TextChannel)>|VoiceChannel)>}
Get a guild's channels via the REST API. REST mode is required to use this endpoint.
- Source:
Returns:
- Type:
-
Promise.<(Array.<(CategoryChannel|ForumChannel|NewsChannel|StageChannel|TextChannel)>|VoiceChannel)>
getRESTEmoji(emojiID) → {Promise.<Object>}
Get a guild emoji via the REST API. REST mode is required to use this endpoint.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
emojiID |
String
|
The ID of the emoji |
Returns:
- Type:
-
Promise.<Object>
An emoji object
getRESTEmojis() → {Promise.<Array.<Object>>}
Get a guild's emojis via the REST API. REST mode is required to use this endpoint.
- Source:
Returns:
- Type:
-
Promise.<Array.<Object>>
An array of guild emoji objects
getRESTMember(memberID) → {Promise.<Member>}
Get a guild's members via the REST API. REST mode is required to use this endpoint.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
memberID |
String
|
The ID of the member |
Returns:
- Type:
-
Promise.<Member>
getRESTMembers(optionsopt, afteropt) → {Promise.<Array.<Member>>}
Get a guild's members via the REST API. REST mode is required to use this endpoint.
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as
|
|||||||||||||||
after |
String
|
<optional> |
[DEPRECATED] The highest user ID of the previous page |
Returns:
- Type:
-
Promise.<Array.<Member>>
getRESTRole(roleID) → {Promise.<Role>}
Get a guild's roles via the REST API. REST mode is required to use this endpoint.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
roleID |
String
|
The ID of the role |
Returns:
- Type:
-
Promise.<Role>
getRESTRoles() → {Promise.<Array.<Role>>}
Get a guild's roles via the REST API. REST mode is required to use this endpoint.
- Source:
Returns:
- Type:
-
Promise.<Array.<Role>>
getRESTScheduledEvent(eventID, optionsopt) → {Promise.<GuildScheduledEvent>}
Get a guild scheduled event via the REST API. REST mode is required to use this endpoint.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
eventID |
String
|
The ID of the guild scheduled event |
|||||||||
options |
Object
|
<optional> |
Options for the request
|
Returns:
- Type:
-
Promise.<GuildScheduledEvent>
getRESTSticker(stickerID) → {Promise.<Object>}
Get a guild sticker via the REST API. REST mode is required to use this endpoint.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
stickerID |
String
|
The ID of the sticker |
Returns:
- Type:
-
Promise.<Object>
A sticker object
getRESTStickers() → {Promise.<Array.<Object>>}
Get a guild's stickers via the REST API. REST mode is required to use this endpoint.
- Source:
Returns:
- Type:
-
Promise.<Array.<Object>>
An array of guild sticker objects
getScheduledEventUsers(eventID, optionsopt)
Get a list of users subscribed to a guild scheduled event
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eventID |
String
|
The ID of the event |
||||||||||||||||||||||||||
options |
Object
|
<optional> |
Options for the request
|
Returns:
getScheduledEvents(optionsopt) → {Promise.<Array.<GuildScheduledEvent>>}
Get the guild's scheduled events
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Options for the request
|
Returns:
- Type:
-
Promise.<Array.<GuildScheduledEvent>>
getSoundboardSound(soundID) → {Promise.<SoundboardSound>}
Get a guild soundboard sound. Not to be confused with getSoundboardSounds, which gets all soundboard sounds in this guild
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
soundID |
String
|
The ID of the soundboard sound |
Returns:
- Type:
-
Promise.<SoundboardSound>
getSoundboardSounds() → {Promise.<Array.<SoundboardSound>>}
Get the guild's soundboard sounds. Not to be confused with getSoundboardSound, which gets a specified soundboard sound
- Source:
Returns:
- Type:
-
Promise.<Array.<SoundboardSound>>
getTemplates() → {Promise.<Array.<GuildTemplate>>}
Get the guild's templates
- Source:
Returns:
- Type:
-
Promise.<Array.<GuildTemplate>>
getVanity() → {Promise}
Returns the vanity url of the guild
- Source:
Returns:
- Type:
-
Promise
getVoiceRegions() → {Promise.<Array.<Object>>}
Get possible voice regions for a guild
- Source:
Returns:
- Type:
-
Promise.<Array.<Object>>
Resolves with an array of voice region objects
getVoiceState(userIDopt) → {Promise.<VoiceState>}
Get a guild user's voice state
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
userID |
String
|
<optional> |
"@me" |
The ID of the user |
Returns:
- Type:
-
Promise.<VoiceState>
getWebhooks() → {Promise.<Array.<Object>>}
Get all the webhooks in the guild
- Source:
Returns:
- Type:
-
Promise.<Array.<Object>>
Resolves with an array of webhook objects
getWelcomeScreen() → {Promise.<Object>}
Get the welcome screen of the Community guild, shown to new members
- Source:
Returns:
- Type:
-
Promise.<Object>
getWidget() → {Promise.<Object>}
Get a guild's widget object
- Source:
Returns:
- Type:
-
Promise.<Object>
A guild widget object
getWidgetImageURL(styleopt) → {String}
Get a guild's widget image
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
style |
String
|
<optional> |
"shield" |
The style of widget image |
Returns:
- Type:
-
String
The image URL of widget image
getWidgetSettings() → {Promise.<Object>}
Get a guild's widget settings object
- Source:
Returns:
- Type:
-
Promise.<Object>
A guild widget settings object
kickMember(userID, reasonopt) → {Promise}
Kick a member from the guild
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
userID |
String
|
The ID of the member |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
permissionsOf(memberID) → {Permission}
Get the guild permissions of a member
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
memberID |
String
|
Member
|
Object
|
The ID of the member or a Member object |
Returns:
- Type:
-
Permission
pruneMembers(optionsopt) → {Promise.<Number>}
Begin pruning the guild
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Number
|
<optional> |
The options to pass to prune members
|
Returns:
- Type:
-
Promise.<Number>
Resolves with the number of pruned members
removeMemberRole(memberID, roleID, reasonopt) → {Promise}
Remove a role from a guild member
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
memberID |
String
|
The ID of the member |
|
roleID |
String
|
The ID of the role |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
searchMembers(query, limitopt) → {Promise.<Array.<Member>>}
Search for guild members by partial nickname/username
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
query |
String
|
The query string to match username(s) and nickname(s) against |
||
limit |
Number
|
<optional> |
1 |
The maximum number of members you want returned, capped at 100 |
Returns:
- Type:
-
Promise.<Array.<Member>>
syncTemplate(code) → {Promise.<GuildTemplate>}
Force a guild template to sync
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
code |
String
|
The template code |
Returns:
- Type:
-
Promise.<GuildTemplate>
unbanMember(userID, reasonopt) → {Promise}
Unban a user from the guild
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
userID |
String
|
The ID of the member |
|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise