Guild

export class Guild extends AnonymousGuild
export class Guild extends AnonymousGuild
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.
Readonly
afkChannel:VoiceChannel | null
AFK voice channel for this guild
afkChannelId:Snowflake | null
The id of the voice channel where AFK members are moved
afkTimeout:number
The time in seconds before a user is counted as "away from keyboard"
applicationId:Snowflake | null
The id of the application that created this guild (if applicable)
approximateMemberCount:number | null
The approximate amount of members the guild has You will need to fetch the guild using if you want to receive this parameter
approximatePresenceCount:number | null
The approximate amount of presences the guild has You will need to fetch the guild using if you want to receive this parameter
autoModerationRules:AutoModerationRuleManager
A manager of the auto moderation rules of this guild.
available:boolean
Whether the guild is available to access. If it is not available, it indicates a server outage
A manager of the bans belonging to this guild
A manager of the channels belonging to this guild
Readonly
client:Client<true>
The client that instantiated this
Inherited from Base
A manager of the application commands belonging to this guild
Readonly
createdAt:Date
The time this guild was created at
Inherited from BaseGuild
Readonly
createdTimestamp:number
The timestamp this guild was created at
Inherited from BaseGuild
defaultMessageNotifications:GuildDefaultMessageNotifications
The default message notification level of the guild
description:string | null
The description of the guild, if any
Inherited from AnonymousGuild
discoverySplash:string | null
The hash of the guild discovery splash image
A manager of the emojis belonging to this guild
explicitContentFilter:GuildExplicitContentFilter
The explicit content filter level of the guild
features:`${GuildFeature}`[]
An array of features available to this guild
Inherited from BaseGuild
icon:string | null
The icon hash of this guild
Inherited from BaseGuild
The guild's id
Inherited from BaseGuild
A manager of the invites of this guild
Readonly
joinedAt:Date
The time the client user joined the guild
joinedTimestamp:number
The timestamp the client user joined the guild at
large:boolean
Whether the guild is "large" (has more than members, 50 by default)
Readonly
maximumBitrate:number
The maximum bitrate available for this guild
maximumMembers:number | null
The maximum amount of members the guild can have
maximumPresences:number | null
The 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 if you want to receive this parameter
maxStageVideoChannelUsers:number | null
The maximum amount of users allowed in a stage video channel.
maxVideoChannelUsers:number | null
The maximum amount of users allowed in a video channel.
memberCount:number
The full amount of members in this guild
A manager of the members belonging to this guild
mfaLevel:GuildMFALevel
The required MFA level for this guild
name:string
The name of this guild
Inherited from BaseGuild
Readonly
nameAcronym:string
The acronym that shows up in place of a guild icon
Inherited from BaseGuild
nsfwLevel:GuildNSFWLevel
The NSFW level of this guild
Inherited from AnonymousGuild
ownerId:Snowflake
The user id of this guild's owner
Readonly
partnered:boolean
Whether this guild is partnered
Inherited from BaseGuild
preferredLocale:Locale
The preferred locale of the guild, defaults to en-US
premiumProgressBarEnabled:boolean
Whether this guild has its premium (boost) progress bar enabled
premiumSubscriptionCount:number | null
The total number of boosts for this server
Inherited from AnonymousGuild
premiumTier:GuildPremiumTier
The premium tier of this guild
presences:PresenceManager
A manager of the presences belonging to this guild
Readonly
publicUpdatesChannel:TextChannel | null
Public updates channel for this guild
publicUpdatesChannelId:Snowflake | null
The community updates channel's id for the guild
A manager of the roles belonging to this guild
Readonly
rulesChannel:TextChannel | null
Rules channel for this guild
rulesChannelId:Snowflake | null
The rules channel's id for the guild
Readonly
safetyAlertsChannel:TextChannel | null
Safety alerts channel for this guild
safetyAlertsChannelId:Snowflake | null
The safety alerts channel's id for the guild
A manager of the scheduled events of this guild
Readonly
The Shard this Guild belongs to.
shardId:number
The id of the shard this Guild belongs to.
splash:string | null
The hash of the guild invite splash image
Inherited from AnonymousGuild
stageInstances:StageInstanceManager
A manager of the stage instances of this guild
A manager of the stickers belonging to this guild
Readonly
systemChannel:TextChannel | null
System channel for this guild
systemChannelFlags:Readonly<SystemChannelFlagsBitField>
The value set for the guild's system channel flags
systemChannelId:Snowflake | null
The system channel's id
vanityURLCode:string | null
The vanity invite code of the guild, if any
Inherited from AnonymousGuild
vanityURLUses:number | null
The 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
verificationLevel:GuildVerificationLevel
The verification level of the guild
Inherited from AnonymousGuild
Readonly
verified:boolean
Whether this guild is verified
Inherited from BaseGuild
Readonly
voiceAdapterCreator:InternalDiscordGatewayAdapterCreator
The voice state adapter for this guild that can be used with discordjs/voice to play audio in voice and stage channels.
voiceStates:VoiceStateManager
A manager of the voice states of this guild
Widget channel for this guild
widgetChannelId:Snowflake | null
The widget channel's id, if enabled
widgetEnabled:boolean | null
Whether widget images are enabled on this guild
bannerURL(options?):string | null
The URL to this guild's banner.
Returns
NameTypeOptionalDescription
optionsImageURLOptionsYesOptions for the image URL
Inherited from AnonymousGuild
createTemplate(name, description?):Promise<GuildTemplate>
Creates a template for the guild.
NameTypeOptionalDescription
namestringNoThe name for the template
descriptionstringYesThe description for the template
delete():Promise<Guild>
Deletes the guild.
disableInvites(disabled?):Promise<Guild>
Sets whether this guild's invites are disabled.
NameTypeOptionalDescription
disabledbooleanYesWhether the invites are disabled
discoverySplashURL(options?):string | null
The URL to this guild's discovery splash image.
Returns
NameTypeOptionalDescription
optionsImageURLOptionsYesOptions for the image URL
edit(options):Promise<Guild>
Updates the guild with new information - e.g. a new name.
NameTypeOptionalDescription
optionsGuildEditOptionsNoThe options to provide
editOnboarding(options):Promise<GuildOnboarding>
Edits the guild onboarding data for this guild.
NameTypeOptionalDescription
optionsGuildOnboardingEditOptionsNoThe options to provide
editWelcomeScreen(options):Promise<WelcomeScreen>
Updates the guild's welcome screen
NameTypeOptionalDescription
optionsWelcomeScreenEditOptionsNoThe options to provide
equals(guild):boolean
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.
NameTypeOptionalDescription
guildGuildNoThe guild to compare with
fetch():Promise<Guild>
Fetches this guild.
Inherited from BaseGuild
fetchAuditLogs(options?):Promise<GuildAuditLogs<T>>
Fetches audit logs for this guild.
NameTypeOptionalDescription
optionsGuildAuditLogsFetchOptions<T>YesOptions for fetching audit logs
fetchIntegrations():Promise<Collection<Snowflake | string, Integration>>
Fetches a collection of integrations to this guild. Resolves with a collection mapping integrations by their ids.
fetchOnboarding():Promise<GuildOnboarding>
Fetches the guild onboarding data for this guild.
fetchOwner(options?):Promise<GuildMember>
Fetches the owner of the guild. If the member object isn't needed, use ownerId instead.
NameTypeOptionalDescription
optionsBaseFetchOptionsYesThe options for fetching the member
fetchPreview():Promise<GuildPreview>
Obtains a guild preview for this guild from Discord.
fetchTemplates():Promise<Collection<GuildTemplate['code'], GuildTemplate>>
Fetches a collection of templates from this guild. Resolves with a collection mapping templates by their codes.
fetchVanityData():Promise<Vanity>
Fetches the vanity URL invite object to this guild. Resolves with an object containing the vanity URL invite code and the use count
fetchWebhooks():Promise<Collection<Snowflake, Webhook>>
Fetches all webhooks for the guild.
fetchWelcomeScreen():Promise<WelcomeScreen>
Fetches the welcome screen for this guild.
fetchWidget():Promise<Widget>
Fetches the guild widget data, requires the widget to be enabled.
fetchWidgetSettings():Promise<GuildWidgetSettings>
Fetches the guild widget settings.
iconURL(options?):string | null
The URL to this guild's icon.
Returns
NameTypeOptionalDescription
optionsImageURLOptionsYesOptions for the image URL
Inherited from BaseGuild
leave():Promise<Guild>
Leaves the guild.
setAFKChannel(afkChannel, reason?):Promise<Guild>
Edits the AFK channel of the guild.
NameTypeOptionalDescription
afkChannelVoiceChannelResolvable | nullNoThe new AFK channel
reasonstringYesReason for changing the guild's AFK channel
setAFKTimeout(afkTimeout, reason?):Promise<Guild>
Edits the AFK timeout of the guild.
NameTypeOptionalDescription
afkTimeoutnumberNoThe time in seconds that a user must be idle to be considered AFK
reasonstringYesReason for changing the guild's AFK timeout
setBanner(banner, reason?):Promise<Guild>
Sets a new guild banner.
NameTypeOptionalDescription
bannerBufferResolvable | Base64Resolvable | nullNoThe new banner of the guild
reasonstringYesReason for changing the guild's banner
setDefaultMessageNotifications(defaultMessageNotifications, reason?):Promise<Guild>
Edits the setting of the default message notifications of the guild.
NameTypeOptionalDescription
defaultMessageNotificationsGuildDefaultMessageNotifications | nullNoThe new default message notification level of the guild
reasonstringYesReason for changing the setting of the default message notifications
setDiscoverySplash(discoverySplash, reason?):Promise<Guild>
Sets a new guild discovery splash image.
NameTypeOptionalDescription
discoverySplashBufferResolvable | Base64Resolvable | nullNoThe new discovery splash image of the guild
reasonstringYesReason for changing the guild's discovery splash image
setExplicitContentFilter(explicitContentFilter, reason?):Promise<Guild>
Edits the level of the explicit content filter.
NameTypeOptionalDescription
explicitContentFilterGuildExplicitContentFilter | nullNoThe new level of the explicit content filter
reasonstringYesReason for changing the level of the guild's explicit content filter
setIcon(icon, reason?):Promise<Guild>
Sets a new guild icon.
NameTypeOptionalDescription
iconBufferResolvable | Base64Resolvable | nullNoThe new icon of the guild
reasonstringYesReason for changing the guild's icon
setMFALevel(level, reason?):Promise<Guild>
Sets the guild's MFA level An elevated MFA level requires guild moderators to have 2FA enabled.
NameTypeOptionalDescription
levelGuildMFALevelNoThe MFA level
reasonstringYesReason for changing the guild's MFA level
setName(name, reason?):Promise<Guild>
Edits the name of the guild.
NameTypeOptionalDescription
namestringNoThe new name of the guild
reasonstringYesReason for changing the guild's name
setOwner(owner, reason?):Promise<Guild>
Sets a new owner of the guild.
NameTypeOptionalDescription
ownerGuildMemberResolvableNoThe new owner of the guild
reasonstringYesReason for setting the new owner
setPreferredLocale(preferredLocale, reason?):Promise<Guild>
Edits the preferred locale of the guild.
NameTypeOptionalDescription
preferredLocaleLocale | nullNoThe new preferred locale of the guild
reasonstringYesReason for changing the guild's preferred locale
setPremiumProgressBarEnabled(enabled?, reason?):Promise<Guild>
Edits the enabled state of the guild's premium progress bar
NameTypeOptionalDescription
enabledbooleanYesThe new enabled state of the guild's premium progress bar
reasonstringYesReason for changing the state of the guild's premium progress bar
setPublicUpdatesChannel(publicUpdatesChannel, reason?):Promise<Guild>
Edits the community updates channel of the guild.
NameTypeOptionalDescription
publicUpdatesChannelTextChannelResolvable | nullNoThe new community updates channel
reasonstringYesReason for changing the guild's community updates channel
setRulesChannel(rulesChannel, reason?):Promise<Guild>
Edits the rules channel of the guild.
NameTypeOptionalDescription
rulesChannelTextChannelResolvable | nullNoThe new rules channel
reasonstringYesReason for changing the guild's rules channel
setSafetyAlertsChannel(safetyAlertsChannel, reason?):Promise<Guild>
Edits the safety alerts channel of the guild.
NameTypeOptionalDescription
safetyAlertsChannelTextChannelResolvable | nullNoThe new safety alerts channel
reasonstringYesReason for changing the guild's safety alerts channel
setSplash(splash, reason?):Promise<Guild>
Sets a new guild invite splash image.
NameTypeOptionalDescription
splashBufferResolvable | Base64Resolvable | nullNoThe new invite splash image of the guild
reasonstringYesReason for changing the guild's invite splash image
setSystemChannel(systemChannel, reason?):Promise<Guild>
Edits the system channel of the guild.
NameTypeOptionalDescription
systemChannelTextChannelResolvable | nullNoThe new system channel
reasonstringYesReason for changing the guild's system channel
setSystemChannelFlags(systemChannelFlags, reason?):Promise<Guild>
Edits the flags of the default message notifications of the guild.
NameTypeOptionalDescription
systemChannelFlagsSystemChannelFlagsResolvableNoThe new flags for the default message notifications
reasonstringYesReason for changing the flags of the default message notifications
setVerificationLevel(verificationLevel, reason?):Promise<Guild>
Edits the verification level of the guild.
NameTypeOptionalDescription
verificationLevelGuildVerificationLevel | nullNoThe new verification level of the guild
reasonstringYesReason for changing the guild's verification level
setWidgetSettings(settings, reason?):Promise<Guild>
Edits the guild's widget settings.
NameTypeOptionalDescription
settingsGuildWidgetSettingsDataNoThe widget settings for the guild
reasonstringYesReason for changing the guild's widget settings
splashURL(options?):string | null
The URL to this guild's invite splash image.
Returns
NameTypeOptionalDescription
optionsImageURLOptionsYesOptions for the image URL
Inherited from AnonymousGuild
toJSON():unknown
toString():string
When concatenated with a string, this automatically returns the guild's name instead of the Guild object.
Inherited from BaseGuild
valueOf():string
widgetImageURL(style?):string
Returns a URL for the PNG widget of the guild.
NameTypeOptionalDescription
styleGuildWidgetStyleYesThe style for the widget image