Options you can pass to discord.Guild.createChannel.
The discord.GuildVoiceChannel's that determines what channel to send idle guild members to after the specified discord.Guild.afkTimeout.
After a guild member in a voice channel is idle for this amount of time (in seconds), they will be moved to the discord.GuildVoiceChannel determined in discord.Guild.afkChannelId (if set).
The application id tied to this guild. Typically set on Discord guilds with commerce features enabled.
If not null, holds a hash of the guild banner image.
The banner typically image appears above the guild channel list.
Use discord.Guild.getBannerUrl to build a full URL for the guild banner image.
Note: Requires the discord.Guild.Feature.BANNER flag in discord.Guild.features to be set.
The default level of notifications new guild members will receive.
Guild members can override this setting individually.
If set, a user-submitted description of the guild. Requires the discord.Guild.Feature.PUBLIC feature flag.
The level of explicit image filtering that will occur on this guild.
A list of discord.Guild.Features available to this guild.
If not null, holds a hash of the guild icon image.
Use discord.Guild.getIconUrl to build a full URL for the guild icon.
The guild's unique Discord id. This field never changes.
The maximum amount of concurrent online users before this guild goes unavailable.
Generally increases as discord.Guild.memberCount increases.
The number of guild members who joined the guild.
The MFA level required to perform actions guarded by elevated discord.Permissions.
The name of the guild.
The user id that owns this guild.
The permissions the bot has on the guild.
The preferred locale of the guild.
The number of boosts this server has.
The current tier this guild has. Dependent on the amount of discord.Guild.premiumSubscriptionCount.
The voice region this server is set to use.
If not null, holds a hash of the guild splash image hash.
The splash image appears as the background of guild invite pages for this guild.
Use discord.Guild.getSplashUrl to build a full URL for the guild splash image.
Note: Requires the discord.Guild.Feature.INVITE_SPLASH flag in discord.Guild.features to be set.
If not null, determines the channel in which receives guild member join and server boot announcements.
If set, the vanity invite code set on this guild. Requires the discord.Guild.Feature.VANITY_URL feature flag.
The level of verification this guild requires to send messages.
If discord.Guild.widgetEnabled is true
, defines the channel users invited by the widget will see on join.
true
if the guild widget is enabled.
Begins a prune operation with the given settings. It is highly recommend to verify the number of users being pruned is accurate using discord.Guild.previewPrune.
By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the includeRoles option. Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.
If the computePruneCount
option is set to true (default), the returned value will be the number of users pruned.
In large guilds, it is recommended to set this to false as it may time out the operation on Discord's end.
Note: This is a costly operation, and should not be run too frequently.
Bans a specific user from the guild.
Note: The user does not have to be a member of the guild to ban them.
The user id or user-like object to ban.
Options for the ban. All values are optional.
Creates a channel on the guild. Requires the discord.Permissions.MANAGE_CHANNELS permissions.
Options for the new channel. Some are optional.
Attempts to create a new emoji with the values provided. Returns the new emoji upon success.
Note: Emojis may be a maximum size of 256kb.
The options to use when creating the new guild emoji.
Creates a role on the guild.
If an error occurs, a discord.ApiError is thrown.
Settings for the new guild role. All fields are optional.
Un-bans or otherwise removes a ban for a specific user from the guild.
The user id or user-like object to un-ban.
Modifies guild settings. Requires the discord.Permissions.MANAGE_GUILD permission.
await guild.edit({
name: "New Guild Name"
});
The settings to change for this guild.
A promise that resolves as the updated guild if successful.
Modifies the role positioning for the set of roles sent in the options
param.
Role positions are important for role hoisting and permission inheritance.
On success, the Promise resolves an array of all guild role objects.
Fetches a discord.GuildBan given a user id.
Resolves with a discord.GuildBan if found, otherwise null
.
Builds a URL for the guild's banner image, if set.
See discord.Guild.banner for more info.
the preferred image type. Defaults to discord.ImageType.PNG.
Fetches an array of discord.GuildBan objects that exist on the guild.
Fetches a single channel from the guild, by id.
The channel id of the channel you want to fetch
An instance of the channel if available, otherwise null
.
Fetches a list of all channels on this guild.
Fetches an array containing the emojis uploaded to this guild.
Builds a URL for the guild's icon, if set.
See discord.Guild.icon for more info.
the preferred image type. Defaults to discord.ImageType.WEBP.
Fetches an array of all discord.GuildInvite objects associated with this guild.
Fetches a single member from the guild, by user id.
If the user is not a member of the guild, or the user is not found, the Promise will resolve as null
.
The id of the member you wish to fetch.
A convenience method to get the bot's voice state for the guild.
Returns null if the bot doesn't have a voice state set.
Fetches an array of all the roles on this guild.
Builds a URL for the guild's splash image, if set.
See discord.Guild.splash for more info.
the preferred image type. Defaults to discord.ImageType.PNG.
Get a member's voice state. Resolves as null
if the member is not connected to a voice channel.
the user to look up
Returns an async iterable for the list of members on this guild.
The runtime will stream members in chunks and yield individual discord.GuildMember instances as they become available. Iteration happens on an ascending basis, sorted by user id.
Keep in mind this can be a particularly expensive operation to call depending on the amount of guild members are in the guild.
ES2015 introduced the for..await..of
statement, allowing you to loop asynchronously over the async generators and functions.
for await (const member of guild.iterMembers()) {
await member.removeRole(SOME_ROLE_ID);
}
Options for the request. All values are optional.
Returns an async iterator over users connected to voice channels in this guild.
You may optionally filter the results by channel, if a channelId is provided with the options object.
options for this query
Returns the number of users that would be removed/kicked from the guild in a prune operation.
By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the includeRoles
option.
Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.
Note: This is a costly operation, and should not be run too frequently.
Sets and overwrites the bot's voice state within the guild.
Using the required channelId
option, you may connect to a voice or disconnect from a voice channel.
If you want to move channels, specify a new channel id.
Disconnect the bot from it's voice session by setting channelId
to null
.
This usually triggers a VOICE_SERVER_UPDATE and/or VOICE_STATE_UPDATE events. Information from these events can be used to externally orchestrate voice protocol sockets.
the new voice state data. overriding any previously-set data.
Generated using TypeDoc
A Guild (aka Discord Server) contains basic guild identifiers, basic guild settings, and accessors to objects related to this guild.
A guild can be found by id with discord.getGuild, but you can usually access it from most objects related to a guild.
For example, discord.Message.getGuild, discord.GuildChannel.getGuild, and discord.GuildMember.getGuild are ways you can access a guild from related objects.