Guild

Guild

Represents a guild

Constructor

new Guild()

Properties:
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: channelID, description, emojiID, emojiName. emojiID and emojiName properties can be null.

widgetChannelID Number <nullable>

The channel id that the widget will generate an invite to. REST only.

widgetEnabled Boolean <nullable>

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

Name Type Attributes Description
deaf Boolean <optional>

Whether the user should be deafened

mute Boolean <optional>

Whether the user should be muted

nick String <optional>

The user's nickname

roles Array.<String> <optional>

Array of role IDs to add to 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

Name Type Attributes Default Description
userIDs Array.<String>

Array of user IDs to ban

deleteMessageSeconds Number <optional>
0

Number of seconds to delete messages for each user, between 0 and 604800 inclusive

reason String <optional>

The reason to be displayed in audit logs

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 defaultMemberPermissions

commands[].description String <optional>

The command description, required for CHAT_INPUT commands

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 1 for CHAT_INPUT, 2 for USER or 3 for MESSAGE

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

Name Type Attributes Default Description
actions Array.<Object>

The actions done when the rule is violated

enabled Boolean <optional>
false

If the rule is enabled, false by default

eventType Number

The event type for the rule

exemptChannels Array.<String> <optional>

Any channels where this rule does not apply

exemptRoles Array.<String> <optional>

Any roles to which this rule does not apply

name String

The name of the rule

triggerMetadata Object <optional>

The trigger metadata for the rule

triggerType Number

The trigger type of the rule

reason String <optional>

The reason to be displayed in audit logs

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 options is a string, it will be treated as options.parentID (see below). Passing a string is deprecated and will not be supported in future versions.

Name Type Attributes Description
availableTags Array.<Object> <optional>

The available tags that can be applied to threads in a forum/media channel. See the official Discord API documentation entry for object structure (forum/media channels only, max 20)

bitrate Number <optional>

The bitrate of the channel (voice channels only)

defaultAutoArchiveDuration Number <optional>

The default duration of newly created threads in minutes to automatically archive the thread after inactivity (60, 1440, 4320, 10080) (text/news/forum/media channels only)

defaultForumLayout Number <optional>

The default forum layout type used to display posts in forum channels (forum channels only)

defaultReactionEmoji Object <optional>

The emoji to show in the add reaction button on a thread in a forum/media channel (forum/media channels only)

defaultSortOrder Number <optional>

The default sort order type used to order posts in forum/media channels (forum/media channels only)

defaultThreadRateLimitPerUser Number <optional>

The initial rateLimitPerUser to set on newly created threads in a channel (text/forum/media channels only)

nsfw Boolean <optional>

The nsfw status of the channel

parentID String <optional>
<nullable>

The ID of the parent category channel for this channel

permissionOverwrites Array.<Object> <optional>

An array containing permission overwrite objects

position Number <optional>

The sorting position of the channel

rateLimitPerUser Number <optional>

The time in seconds a user has to wait before sending another message (0-21600) (does not affect bots or users with manageMessages/manageChannel permissions) (text/voice/stage/forum/media channels only)

reason String <optional>

The reason to be displayed in audit logs

topic String <optional>

The topic of the channel (text channels only)

userLimit Number <optional>

The channel user limit (voice channels only)

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 defaultMemberPermissions

command.description String <optional>

The command description, required for CHAT_INPUT commands

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 1 for CHAT_INPUT, 2 for USER or 3 for MESSAGE

Returns:
Type:
Promise.<ApplicationCommand>

Resolves with the created application command

createEmoji(options, reasonopt) → {Promise.<Object>}

Create a emoji in the guild

Source:
Parameters:
Name Type Attributes Description
options Object

Emoji options

Name Type Attributes Description
image String

The base 64 encoded string

name String

The name of emoji

roles Array <optional>

An array containing authorized role IDs

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

Name Type Attributes Description
color Number <optional>

The hex color of the role, in number form (ex: 0x3d15b3 or 4040115)

hoist Boolean <optional>

Whether to hoist the role in the user list or not

icon String <optional>

The role icon as a base64 data URI

mentionable Boolean <optional>

Whether the role is mentionable or not

name String <optional>

The name of the role

permissions BigInt | Number | String | Permission <optional>

The role permissions

unicodeEmoji String <optional>

The role's unicode emoji

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

Name Type Attributes Description
channelID String <optional>

The channel ID of the event. This is optional if entityType is 3 (external)

description String <optional>

The description of the event

entityMetadata Object <optional>

The entity metadata for the scheduled event. This is required if entityType is 3 (external)

Name Type Attributes Description
location String <optional>

Location of the event

entityType Number

The entity type of the scheduled event

image String <optional>

Base 64 encoded image for the scheduled event

name String

The name of the event

privacyLevel String

The privacy level of the event

recurrenceRule Object <optional>

The definitions for how often this event should recur. Properties can be camelCase (preferred) or snake_case

scheduledEndTime Date <optional>

The time when the event is scheduled to end. This is required if entityType is 3 (external)

scheduledStartTime Date

The time the event will start

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

Name Type Attributes Default Description
emojiID String <optional>
<nullable>

The ID of the relating custom emoji (mutually exclusive with sound.emojiName)

emojiName String <optional>
<nullable>

The name of the relating default emoji (mutually exclusive with sound.emojiID)

name String

The name of the soundboard sound (2-32 characters)

sound String

The base 64 encoded mp3/ogg sound data

volume Number <optional>
<nullable>
1

The volume of the soundboard sound, between 0 and 1

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

Name Type Attributes Description
description String <optional>

The description of the sticker

file Object

A file object

Name Type Description
file Buffer

A buffer containing file data

name String

What to name the file

name String

The name of the sticker

tags String

The Discord name of a unicode emoji representing the sticker's expression

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

Name Type Attributes Description
afkChannelID String <optional>
<nullable>

The ID of the AFK voice channel

afkTimeout Number <optional>

The AFK timeout in seconds

banner String <optional>
<nullable>

The guild banner image as a base64 data URI (VIP only). Note: base64 strings alone are not base64 data URI strings

defaultNotifications Number <optional>
<nullable>

The default notification settings for the guild. 0 is "All Messages", 1 is "Only @mentions".

description String <optional>
<nullable>

The description for the guild (VIP only)

discoverySplash String <optional>
<nullable>

The guild discovery splash image as a base64 data URI (VIP only). Note: base64 strings alone are not base64 data URI strings

explicitContentFilter Number <optional>
<nullable>

The level of the explicit content filter for messages/images in the guild. 0 disables message scanning, 1 enables scanning the messages of members without roles, 2 enables scanning for all messages.

features Array.<String> <optional>

The enabled features for the guild. Note that only certain features can be toggled with the API

icon String <optional>
<nullable>

The guild icon as a base64 data URI. Note: base64 strings alone are not base64 data URI strings

name String <optional>

The name of the guild

preferredLocale String <optional>
<nullable>

Preferred "COMMUNITY" guild language used in server discovery and notices from Discord

publicUpdatesChannelID String <optional>
<nullable>

The ID of the channel where admins and moderators of "COMMUNITY" guilds receive notices from Discord

rulesChannelID String <optional>
<nullable>

The ID of the channel where "COMMUNITY" guilds display rules and/or guidelines

safetyAlertsChannelID String <optional>
<nullable>

The ID of the channel where admins and moderators of Community guilds receive safety alerts from Discord

splash String <optional>
<nullable>

The guild splash image as a base64 data URI (VIP only). Note: base64 strings alone are not base64 data URI strings

systemChannelFlags Number <optional>

The flags for the system channel

systemChannelID String <optional>
<nullable>

The ID of the system channel

verificationLevel Number <optional>
<nullable>

The guild verification level

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

Name Type Attributes Default Description
actions Array.<Object> <optional>

The actions done when the rule is violated

enabled Boolean <optional>
false

If the rule is enabled, false by default

eventType Number <optional>

The event type for the rule

exemptChannels Array.<String> <optional>

Any channels where this rule does not apply

exemptRoles Array.<String> <optional>

Any roles to which this rule does not apply

name String <optional>

The name of the rule

triggerMetadata Object <optional>

The trigger metadata for the rule

triggerType Number <optional>

The trigger type of the rule

reason String <optional>

The reason to be displayed in audit logs

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

Name Type Attributes Description
id String

The ID of the channel

lockPermissions Boolean <optional>

Whether to sync the channel's permissions with the new parent, if changing parents

parentID String <optional>

The new parent ID (category channel) for the channel that is moved. For each request, only one channel can change parents

position Number

The new position of the channel

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 defaultMemberPermissions

command.description String <optional>

The command description, required for CHAT_INPUT commands

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

Returns:
Type:
Promise.<ApplicationCommand>

Resolves with the edited application command

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

Returns:
Type:
Promise.<Object>

Resolves with a GuildApplicationCommandPermissions object.

editDiscovery(optionsopt) → {Promise.<Object>}

Edit the guild's discovery data

Source:
Parameters:
Name Type Attributes Description
options Object <optional>

The guild discovery data

Name Type Attributes Description
emojiDiscoverabilityEnabled Boolean <optional>

Whether guild info should be shown when emoji info is loaded

keywords Array.<String> <optional>

The discovery keywords (max 10)

primaryCategoryID String <optional>

The primary discovery category ID

reason String <optional>

The reason to be displayed in audit logs

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

Name Type Attributes Description
name String <optional>

The name of emoji

roles Array <optional>

An array containing authorized role IDs

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

Name Type Attributes Description
channelID String <optional>
<nullable>

The ID of the voice channel to move the member to (must be in voice). Set to null to disconnect the member

communicationDisabledUntil Date <optional>
<nullable>

When the user's timeout should expire. Set to null to instantly remove timeout

deaf Boolean <optional>

Server deafen the member

flags Number <optional>

The user's flags - OR the BYPASSES_VERIFICATION flag (4) to make the member exempt from verification requirements, NAND the flag to make the member not exempt

mute Boolean <optional>

Server mute the member

nick String <optional>

Set the member's guild nickname, "" to remove

roles Array.<String> <optional>

The array of role IDs the member should have

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

Name Type Description
defaultChannelIDs Array.<String>

The ID of channels that members are opted into automatically

enabled Boolean

Whether onboarding should be enabled or not for the guild

mode Number

The onboarding mode, 0 for default, 1 for advanced

prompts Array.<Object>

The prompts shown during the onboarding process

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

The guild's onboarding settings

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

Name Type Attributes Description
color Number <optional>

The hex color of the role, in number form (ex: 0x3da5b3 or 4040115)

hoist Boolean <optional>

Whether to hoist the role in the user list or not

icon String <optional>

The role icon as a base64 data URI

mentionable Boolean <optional>

Whether the role is mentionable or not

name String <optional>

The name of the role

permissions BigInt | Number | String | Permission <optional>

The role permissions

unicodeEmoji String <optional>

The role's unicode emoji

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

Name Type Attributes Description
channelID String <optional>

The channel ID of the event. If updating entityType to 3 (external), this must be set to null

description String <optional>

The description of the event

entityMetadata Object <optional>

The entity metadata for the scheduled event. This is required if updating entityType to 3 (external)

Name Type Attributes Description
location String <optional>

Location of the event. This is required if updating entityType to 3 (external)

entityType Number <optional>

The entity type of the scheduled event

image String <optional>

Base 64 encoded image for the event

name String <optional>

The name of the event

privacyLevel String <optional>

The privacy level of the event

recurrenceRule Object <optional>
<nullable>

The definitions for how often this event should recur. Properties can be camelCase (preferred) or snake_case

scheduledEndTime Date <optional>

The time when the scheduled event is scheduled to end. This is required if updating entityType to 3 (external)

scheduledStartTime Date <optional>

The time the event will start

status Number <optional>

The status of the scheduled event

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

Name Type Attributes Description
description String <optional>

The description of the sticker

name String <optional>

The name of the sticker

tags String <optional>

The Discord name of a unicode emoji representing the sticker's expression

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

Name Type Attributes Description
description String <optional>
<nullable>

The desription for the template. Set to null to remove the description

name String <optional>

The name of the template

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

Name Type Attributes Description
channelID String

The ID of the channel the user is currently in

requestToSpeakTimestamp Date <optional>
<nullable>

Sets the user's request to speak - this can only be used when the userID param is "@me"

suppress Boolean <optional>

Toggles the user's suppress state

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

Name Type Attributes Description
description String <optional>
<nullable>

The description in the welcome screen

enabled Boolean <optional>

Whether the welcome screen is enabled

welcomeChannels Array.<Object> <optional>

The list of channels in the welcome screen as an array

Name Type Attributes Description
channelID String

The channel ID of the welcome channel

description String

The description of the welcome channel

emojiID String <nullable>

The emoji ID of the welcome channel

emojiName String <nullable>

The emoji name of the welcome channel

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)

Name Type Attributes Description
enabled Boolean <optional>

Whether the guild widget is enabled

channelID String <optional>
<nullable>

The channel ID for the guild widget

reason String <optional>
<nullable>

The reason to be displayed in audit logs

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 requestTimeout client option

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

Name Type Attributes Description
limit Number <optional>

The maximum number of members to fetch

presences Boolean <optional>

Whether to request member presences or not. When using intents, the GUILD_PRESENCES intent is required.

query String <optional>

The query used for looking up the members. When using intents, GUILD_MEMBERS is required to fetch all members.

timeout Number <optional>

The number of milliseconds to wait before resolving early. Defaults to the requestTimeout client option

userIDs Array.<String> <optional>

The IDs of members to fetch

Returns:
Type:
Promise.<Array.<Member>>

Resolves with the fetched 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

Name Type Attributes Description
timeout Number <optional>

The number of milliseconds to wait before resolving early. Defaults to the requestTimeout client option

Returns:
Type:
Promise.<Array.<SoundboardSound>>

Resolves with the fetched 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 options.limit

Name Type Attributes Default Description
actionType Number <optional>

Filter entries by action type

before String <optional>

Get entries before this entry ID

limit Number <optional>
50

The maximum number of entries to return

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>}>

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

Name Type Attributes Default Description
after String <optional>

Only get users after given user ID

before String <optional>

Only get users before given user ID

limit Number <optional>
1000

The maximum number of users to return

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:
Returns:
Type:
Promise.<Object>

The guild's onboarding settings

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

Name Type Attributes Default Description
days Number <optional>
7

The number of days of inactivity to prune for

includeRoles Array.<String> <optional>

An array of role IDs that members must have to be considered for pruning

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:

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 options.limit

Name Type Attributes Default Description
after String <optional>

The highest user ID of the previous page

limit Number <optional>
1

The max number of members to get (1 to 1000)

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

Name Type Attributes Description
withUserCount Boolean <optional>

Whether to include the number of users subscribed to the event

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

Name Type Attributes Default Description
after String <optional>

Get users after this user ID. If options.before is provided, this will be ignored. Fetching users in between before and after is not supported

before String <optional>

Get users before this user ID

limit Number <optional>
100

The number of users to get (max 100). Pagination will only work if one of options.after or options.after is also provided

withMember Boolean <optional>

Include guild member data

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

Name Type Attributes Description
withUserCount Boolean <optional>

Whether to include the number of users subscribed to each event

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

leave() → {Promise}

Leave the guild

Source:
Returns:
Type:
Promise

leaveVoiceChannel()

Leaves the voice channel in this guild

Source:

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

Name Type Attributes Default Description
computePruneCount Boolean <optional>
true

Whether or not the number of pruned members should be returned. Discord discourages setting this to true for larger guilds

days Number <optional>
7

The number of days of inactivity to prune for

includeRoles Array.<String> <optional>

An array of role IDs that members must have to be considered for pruning

reason String <optional>

The reason to be displayed in audit logs

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