Represents a guild (or a server) on Discord. It's recommended to see if a guild is available before performing operations or reading data from it. You can check this with available.
Extends
AnonymousGuildThe approximate amount of members the guild has You will need to fetch the guild using fetch if you want to receive this parameter
The approximate amount of presences the guild has You will need to fetch the guild using fetch if you want to receive this parameter
The hash of the guild banner
Inherited from AnonymousGuildThe description of the guild, if any
Inherited from AnonymousGuildAn array of features available to this guild
Inherited from BaseGuildThe maximum amount of presences the guild can have (this is
null
for all but the largest of guilds) You will need to fetch the guild using fetch if you want to receive this parameterThe maximum amount of users allowed in a stage video channel.
The acronym that shows up in place of a guild icon
Inherited from BaseGuildThe NSFW level of this guild
Inherited from AnonymousGuildThe hash of the guild invite splash image
Inherited from AnonymousGuildThe vanity invite code of the guild, if any
Inherited from AnonymousGuildThe use count of the vanity URL code of the guild, if any You will need to fetch this parameter using fetchVanityData if you want to receive it
The verification level of the guild
Inherited from AnonymousGuildThe voice state adapter for this guild that can be used with
@discordjs/voice
to play audio in voice and stage channels.Readonly
widgetChannel: TextChannel | AnnouncementChannel | VoiceBasedChannel | ForumChannel | MediaChannel | null
Widget channel for this guild
The URL to this guild's banner.
Returns
Name | Type | Optional | Description |
---|---|---|---|
options | ImageURLOptions | Yes | Options for the image URL |
Creates a template for the guild.
Deletes the guild.
Example
Sets whether this guild's invites are disabled.
Name | Type | Optional | Description |
---|---|---|---|
disabled | boolean | Yes | Whether the invites are disabled |
The URL to this guild's discovery splash image.
Returns
Name | Type | Optional | Description |
---|---|---|---|
options | ImageURLOptions | Yes | Options for the image URL |
Updates the guild with new information - e.g. a new name.
Example
Name | Type | Optional | Description |
---|---|---|---|
options | GuildEditOptions | No | The options to provide |
Edits the guild onboarding data for this guild.
Name | Type | Optional | Description |
---|---|---|---|
options | GuildOnboardingEditOptions | No | The options to provide |
Updates the guild's welcome screen
Example
Name | Type | Optional | Description |
---|---|---|---|
options | WelcomeScreenEditOptions | No | The options to provide |
Whether this guild equals another guild. It compares all properties, so for most operations it is advisable to just compare
guild.id === guild2.id
as it is much faster and is often what most users need.Name | Type | Optional | Description |
---|---|---|---|
guild | Guild | No | The guild to compare with |
Fetches this guild.
Inherited from BaseGuildFetches audit logs for this guild.
Example
Name | Constraints | Optional | Default | Description |
---|---|---|---|---|
Event | GuildAuditLogsResolvable | Yes | AuditLogEvent | None |
Name | Type | Optional | Description |
---|---|---|---|
options | GuildAuditLogsFetchOptions<Event> | Yes | Options for fetching audit logs |
Fetches a collection of integrations to this guild. Resolves with a collection mapping integrations by their ids.
Example
Fetches the guild onboarding data for this guild.
Fetches the owner of the guild. If the member object isn't needed, use ownerId instead.
Name | Type | Optional | Description |
---|---|---|---|
options | BaseFetchOptions | Yes | The options for fetching the member |
Obtains a guild preview for this guild from Discord.
Fetches a collection of templates from this guild. Resolves with a collection mapping templates by their codes.
Fetches the vanity URL invite object to this guild. Resolves with an object containing the vanity URL invite code and the use count
Example
fetchWebhooks():Promise<Collection<Snowflake, Webhook<WebhookType.ChannelFollower | WebhookType.Incoming>>>
Fetches all webhooks for the guild.
Example
Fetches the welcome screen for this guild.
Fetches the guild widget data, requires the widget to be enabled.
Example
Fetches the guild widget settings.
Example
The URL to this guild's icon.
Returns
Name | Type | Optional | Description |
---|---|---|---|
options | ImageURLOptions | Yes | Options for the image URL |
Leaves the guild.
Example
Edits the AFK channel of the guild.
Example
Name | Type | Optional | Description |
---|---|---|---|
afkChannel | VoiceChannelResolvable | null | No | The new AFK channel |
reason | string | Yes | Reason for changing the guild's AFK channel |
Edits the AFK timeout of the guild.
Example
Sets a new guild banner.
Example
Name | Type | Optional | Description |
---|---|---|---|
banner | BufferResolvable | Base64Resolvable | null | No | The new banner of the guild |
reason | string | Yes | Reason for changing the guild's banner |
Edits the setting of the default message notifications of the guild.
Name | Type | Optional | Description |
---|---|---|---|
defaultMessageNotifications | GuildDefaultMessageNotifications | null | No | The new default message notification level of the guild |
reason | string | Yes | Reason for changing the setting of the default message notifications |
Sets a new guild discovery splash image.
Example
Name | Type | Optional | Description |
---|---|---|---|
discoverySplash | BufferResolvable | Base64Resolvable | null | No | The new discovery splash image of the guild |
reason | string | Yes | Reason for changing the guild's discovery splash image |
Edits the level of the explicit content filter.
Name | Type | Optional | Description |
---|---|---|---|
explicitContentFilter | GuildExplicitContentFilter | null | No | The new level of the explicit content filter |
reason | string | Yes | Reason for changing the level of the guild's explicit content filter |
Sets a new guild icon.
Example
Name | Type | Optional | Description |
---|---|---|---|
icon | BufferResolvable | Base64Resolvable | null | No | The new icon of the guild |
reason | string | Yes | Reason for changing the guild's icon |
Sets the guild's MFA level An elevated MFA level requires guild moderators to have 2FA enabled.
Example
Name | Type | Optional | Description |
---|---|---|---|
level | GuildMFALevel | No | The MFA level |
reason | string | Yes | Reason for changing the guild's MFA level |
Edits the name of the guild.
Example
Sets a new owner of the guild.
Example
Name | Type | Optional | Description |
---|---|---|---|
owner | GuildMemberResolvable | No | The new owner of the guild |
reason | string | Yes | Reason for setting the new owner |
Edits the preferred locale of the guild.
Example
Edits the enabled state of the guild's premium progress bar
Edits the community updates channel of the guild.
Example
Name | Type | Optional | Description |
---|---|---|---|
publicUpdatesChannel | TextChannelResolvable | null | No | The new community updates channel |
reason | string | Yes | Reason for changing the guild's community updates channel |
Edits the rules channel of the guild.
Example
Name | Type | Optional | Description |
---|---|---|---|
rulesChannel | TextChannelResolvable | null | No | The new rules channel |
reason | string | Yes | Reason for changing the guild's rules channel |
Edits the safety alerts channel of the guild.
Example
Name | Type | Optional | Description |
---|---|---|---|
safetyAlertsChannel | TextChannelResolvable | null | No | The new safety alerts channel |
reason | string | Yes | Reason for changing the guild's safety alerts channel |
Sets a new guild invite splash image.
Example
Name | Type | Optional | Description |
---|---|---|---|
splash | BufferResolvable | Base64Resolvable | null | No | The new invite splash image of the guild |
reason | string | Yes | Reason for changing the guild's invite splash image |
Edits the system channel of the guild.
Example
Name | Type | Optional | Description |
---|---|---|---|
systemChannel | TextChannelResolvable | null | No | The new system channel |
reason | string | Yes | Reason for changing the guild's system channel |
Edits the flags of the default message notifications of the guild.
Name | Type | Optional | Description |
---|---|---|---|
systemChannelFlags | SystemChannelFlagsResolvable | No | The new flags for the default message notifications |
reason | string | Yes | Reason for changing the flags of the default message notifications |
Edits the verification level of the guild.
Example
Name | Type | Optional | Description |
---|---|---|---|
verificationLevel | GuildVerificationLevel | null | No | The new verification level of the guild |
reason | string | Yes | Reason for changing the guild's verification level |
Edits the guild's widget settings.
Name | Type | Optional | Description |
---|---|---|---|
settings | GuildWidgetSettingsData | No | The widget settings for the guild |
reason | string | Yes | Reason for changing the guild's widget settings |
The URL to this guild's invite splash image.
Returns
Name | Type | Optional | Description |
---|---|---|---|
options | ImageURLOptions | Yes | Options for the image URL |
When concatenated with a string, this automatically returns the guild's name instead of the Guild object.
Inherited from BaseGuildReturns a URL for the PNG widget of the guild.
Name | Type | Optional | Description |
---|---|---|---|
style | GuildWidgetStyle | Yes | The style for the widget image |