Skip to content

Guild ​

classe · Source

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 Guild#available.

Extends: AnonymousGuild

Properties ​

members ​

members: GuildMemberManager

A manager of the members belonging to this guild Source

channels ​

channels: GuildChannelManager

A manager of the channels belonging to this guild Source

bans ​

bans: GuildBanManager

A manager of the bans belonging to this guild Source

roles ​

roles: RoleManager

A manager of the roles belonging to this guild Source

presences ​

presences: PresenceManager

A manager of the presences belonging to this guild Source

voiceStates ​

voiceStates: VoiceStateManager

A manager of the voice states of this guild Source

stageInstances ​

stageInstances: StageInstanceManager

A manager of the stage instances of this guild Source

invites ​

invites: GuildInviteManager

A manager of the invites of this guild Source

scheduledEvents ​

scheduledEvents: GuildScheduledEventManager

A manager of the scheduled events of this guild Source

autoModerationRules ​

autoModerationRules: AutoModerationRuleManager

A manager of the auto moderation rules of this guild. Source

settings ​

settings: GuildSettingManager

All of the settings ObjectSource

available ​

available: boolean

Whether the guild is available to access. If it is not available, it indicates a server outage Source

shardId ​

shardId: number

The id of the shard this Guild belongs to. Source

deleted ​

deprecated

deleted: boolean

Whether or not the structure has been deleted Source

shard ​

readonly

shard: WebSocketShard

The Shard this Guild belongs to. Source

discoverySplash ​

nullable

discoverySplash: string

The hash of the guild discovery splash image Source

memberCount ​

memberCount: number

The full amount of members in this guild Source

large ​

large: boolean

Whether the guild is "large" (has more than large_threshold members, 50 by default) Source

premiumProgressBarEnabled ​

premiumProgressBarEnabled: boolean

Whether this guild has its premium (boost) progress bar enabled Source

applicationId ​

nullable

applicationId: Snowflake

The id of the application that created this guild (if applicable) Source

afkTimeout ​

nullable

afkTimeout: number

The time in seconds before a user is counted as "away from keyboard" Source

afkChannelId ​

nullable

afkChannelId: Snowflake

The id of the voice channel where AFK members are moved Source

systemChannelId ​

nullable

systemChannelId: Snowflake

The system channel's id Source

premiumTier ​

premiumTier: PremiumTier

The premium tier of this guild Source

widgetEnabled ​

nullable

widgetEnabled: boolean

Whether widget images are enabled on this guild Source

widgetChannelId ​

nullable

widgetChannelId: string

The widget channel's id, if enabled Source

explicitContentFilter ​

explicitContentFilter: ExplicitContentFilterLevel

The explicit content filter level of the guild Source

mfaLevel ​

mfaLevel: MFALevel

The required MFA level for this guild Source

joinedTimestamp ​

joinedTimestamp: number

The timestamp the client user joined the guild at Source

defaultMessageNotifications ​

defaultMessageNotifications: DefaultMessageNotificationLevel

The default message notification level of the guild Source

systemChannelFlags ​

systemChannelFlags: Readonly<SystemChannelFlags>

The value set for the guild's system channel flags Source

maximumMembers ​

nullable

maximumMembers: number

The maximum amount of members the guild can have Source

maximumPresences ​

nullable

maximumPresences: number

The maximum amount of presences the guild can have You will need to fetch the guild using Guild#fetch if you want to receive this parameter Source

maxVideoChannelUsers ​

nullable

maxVideoChannelUsers: number

The maximum amount of users allowed in a video channel. Source

maxStageVideoChannelUsers ​

nullable

maxStageVideoChannelUsers: number

The maximum amount of users allowed in a stage video channel. Source

approximateMemberCount ​

nullable

approximateMemberCount: number

The approximate amount of members the guild has You will need to fetch the guild using Guild#fetch if you want to receive this parameter Source

approximatePresenceCount ​

nullable

approximatePresenceCount: number

The approximate amount of presences the guild has You will need to fetch the guild using Guild#fetch if you want to receive this parameter Source

vanityURLUses ​

nullable

vanityURLUses: number

The use count of the vanity URL code of the guild, if any You will need to fetch this parameter using Guild#fetchVanityData if you want to receive it Source

rulesChannelId ​

nullable

rulesChannelId: Snowflake

The rules channel's id for the guild Source

publicUpdatesChannelId ​

nullable

publicUpdatesChannelId: Snowflake

The community updates channel's id for the guild Source

preferredLocale ​

preferredLocale: Locale

The preferred locale of the guild, defaults to en-USSource

safetyAlertsChannelId ​

nullable

safetyAlertsChannelId: Snowflake

The safety alerts channel's id for the guild Source

ownerId ​

ownerId: Snowflake

The user id of this guild's owner Source

emojis ​

emojis: GuildEmojiManager

A manager of the emojis belonging to this guild Source

stickers ​

stickers: GuildStickerManager

A manager of the stickers belonging to this guild Source

incidentsData ​

nullable

incidentsData: IncidentActions

The incidents data of this guild. You will need to fetch the guild using BaseGuild#fetch if you want to receive this property. Source

joinedAt ​

readonly

joinedAt: Date

The time the client user joined the guild Source

afkChannel ​

readonly · nullable

afkChannel: VoiceChannel

AFK voice channel for this guild Source

systemChannel ​

readonly · nullable

systemChannel: TextChannel

System channel for this guild Source

safetyAlertsChannel ​

readonly · nullable

safetyAlertsChannel: TextChannel

Safety alerts channel for this guild Source

widgetChannel ​

readonly · nullable

widgetChannel: TextChannel | NewsChannel | VoiceChannel | StageChannel | ForumChannel | MediaChannel

Widget channel for this guild Source

rulesChannel ​

readonly · nullable

rulesChannel: TextChannel

Rules channel for this guild Source

publicUpdatesChannel ​

readonly · nullable

publicUpdatesChannel: TextChannel

Public updates channel for this guild Source

me ​

readonly · nullable · deprecated

me: GuildMember

The client user as a GuildMember of this guild Source

maximumBitrate ​

readonly

maximumBitrate: number

The maximum bitrate available for this guild Source

maximumStageBitrate ​

readonly

maximumStageBitrate: number

The maximum bitrate available for a stage channel in this guild. Source

voiceAdapterCreator ​

readonly

voiceAdapterCreator: function

The voice state adapter for this guild that can be used with @discordjs/voice to play audio in voice and stage channels. Source

splash ​

nullable

splash: string

The hash of the guild invite splash image Source

nullable

banner: string

The hash of the guild banner Source

description ​

nullable

description: string

The description of the guild, if any Source

verificationLevel ​

verificationLevel: VerificationLevel

The verification level of the guild Source

vanityURLCode ​

nullable

vanityURLCode: string

The vanity invite code of the guild, if any Source

nsfwLevel ​

nsfwLevel: NSFWLevel

The NSFW level of this guild Source

premiumSubscriptionCount ​

nullable

premiumSubscriptionCount: number

The total number of boosts for this server Source

id ​

id: Snowflake

The guild's id Source

name ​

name: string

The name of this guild Source

icon ​

nullable

icon: string

The icon hash of this guild Source

features ​

features: Array<Features>

An array of features available to this guild Source

createdTimestamp ​

readonly

createdTimestamp: number

The timestamp this guild was created at Source

createdAt ​

readonly

createdAt: Date

The time this guild was created at Source

nameAcronym ​

readonly

nameAcronym: string

The acronym that shows up in place of a guild icon Source

partnered ​

readonly

partnered: boolean

Whether this guild is partnered Source

verified ​

readonly

verified: boolean

Whether this guild is verified Source

client ​

readonly

client: Client

The client that instantiated this Source

Methods ​

discoverySplashURL ​

discoverySplashURL(options?: StaticImageURLOptions): string

The URL to this guild's discovery splash image. Parameters

NameTypeDescription
options?StaticImageURLOptionsOptions for the Image URL Default: {}.

Returns: stringSource

fetchOwner ​

fetchOwner(options?: BaseFetchOptions): Promise<GuildMember>

Fetches the owner of the guild. If the member object isn't needed, use Guild#ownerId instead. Parameters

NameTypeDescription
options?BaseFetchOptionsThe options for fetching the member

Returns: Promise<GuildMember>Source

fetchIntegrations ​

async

async fetchIntegrations(): Promise<Collection<(Snowflake|string), Integration>>

Fetches a collection of integrations to this guild. Resolves with a collection mapping integrations by their ids. Returns: Promise<Collection<(Snowflake\|string), Integration>>

js
// Fetch integrations
guild.fetchIntegrations()
  .then(integrations => console.log(`Fetched ${integrations.size} integrations`))
  .catch(console.error);

Source

fetchTemplates ​

async

async fetchTemplates(): Promise<Collection<string, GuildTemplate>>

Fetches a collection of templates from this guild. Resolves with a collection mapping templates by their codes. Returns: Promise<Collection<string, GuildTemplate>>Source

fetchWelcomeScreen ​

async

async fetchWelcomeScreen(): Promise<WelcomeScreen>

Fetches the welcome screen for this guild. Returns: Promise<WelcomeScreen>Source

createTemplate ​

async

async createTemplate(name: string, description?: string): Promise<GuildTemplate>

Creates a template for the guild. Parameters

NameTypeDescription
namestringThe name for the template
description?stringThe description for the template

Returns: Promise<GuildTemplate>Source

fetchPreview ​

async

async fetchPreview(): Promise<GuildPreview>

Obtains a guild preview for this guild from Discord. Returns: Promise<GuildPreview>Source

fetchVanityData ​

async

async 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 Returns: Promise<Vanity>

js
// Fetch invite data
guild.fetchVanityData()
  .then(res => {
    console.log(`Vanity URL: https://discord.gg/${res.code} with ${res.uses} uses`);
  })
  .catch(console.error);

Source

fetchWebhooks ​

async

async fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>

Fetches all webhooks for the guild. Returns: Promise<Collection<Snowflake, Webhook>>

js
// Fetch webhooks
guild.fetchWebhooks()
  .then(webhooks => console.log(`Fetched ${webhooks.size} webhooks`))
  .catch(console.error);

Source

fetchWidget ​

fetchWidget(): Promise<Widget>

Fetches the guild widget data, requires the widget to be enabled. Returns: Promise<Widget>

js
// Fetches the guild widget data
guild.fetchWidget()
  .then(widget => console.log(`The widget shows ${widget.channels.size} channels`))
  .catch(console.error);

Source

fetchWidgetSettings ​

async

async fetchWidgetSettings(): Promise<GuildWidgetSettings>

Fetches the guild widget settings. Returns: Promise<GuildWidgetSettings>

js
// Fetches the guild widget settings
guild.fetchWidgetSettings()
  .then(widget => console.log(`The widget is ${widget.enabled ? 'enabled' : 'disabled'}`))
  .catch(console.error);

Source

fetchAuditLogs ​

async

async fetchAuditLogs(options?: GuildAuditLogsFetchOptions): Promise<GuildAuditLogs>

Fetches audit logs for this guild. Parameters

NameTypeDescription
options?GuildAuditLogsFetchOptionsOptions for fetching audit logs Default: {}.

Returns: Promise<GuildAuditLogs>

js
// Output audit log entries
guild.fetchAuditLogs()
  .then(audit => console.log(audit.entries.first()))
  .catch(console.error);

Source

edit ​

async

async edit(data: GuildEditData, reason?: string): Promise<Guild>

Updates the guild with new information - e.g. a new name. Parameters

NameTypeDescription
dataGuildEditDataThe data to update the guild with
reason?stringReason for editing this guild

Returns: Promise<Guild>

js
// Set the guild name
guild.edit({
  name: 'Discord Guild',
})
  .then(updated => console.log(`New guild name ${updated}`))
  .catch(console.error);

Source

editWelcomeScreen ​

async

async editWelcomeScreen(data: WelcomeScreenEditData): Promise<WelcomeScreen>

Updates the guild's welcome screen Parameters

NameTypeDescription
dataWelcomeScreenEditDataData to edit the welcome screen with

Returns: Promise<WelcomeScreen>

js
guild.editWelcomeScreen({
  description: 'Hello World',
  enabled: true,
  welcomeChannels: [
    {
      description: 'foobar',
      channel: '222197033908436994',
    }
  ],
})

Source

setExplicitContentFilter ​

setExplicitContentFilter(explicitContentFilter: ExplicitContentFilterLevel | number, reason?: string): Promise<Guild>

Edits the level of the explicit content filter. Parameters

NameTypeDescription
explicitContentFilterExplicitContentFilterLevel | numberThe new level of the explicit content filter
reason?stringReason for changing the level of the guild's explicit content filter

Returns: Promise<Guild>Source

setDefaultMessageNotifications ​

setDefaultMessageNotifications(defaultMessageNotifications: DefaultMessageNotificationLevel | number, reason?: string): Promise<Guild>

Edits the setting of the default message notifications of the guild. Parameters

NameTypeDescription
defaultMessageNotificationsDefaultMessageNotificationLevel | numberThe new default message notification level of the guild
reason?stringReason for changing the setting of the default message notifications

Returns: Promise<Guild>Source

setSystemChannelFlags ​

setSystemChannelFlags(systemChannelFlags: SystemChannelFlagsResolvable, reason?: string): Promise<Guild>

Edits the flags of the default message notifications of the guild. Parameters

NameTypeDescription
systemChannelFlagsSystemChannelFlagsResolvableThe new flags for the default message notifications
reason?stringReason for changing the flags of the default message notifications

Returns: Promise<Guild>Source

setName ​

setName(name: string, reason?: string): Promise<Guild>

Edits the name of the guild. Parameters

NameTypeDescription
namestringThe new name of the guild
reason?stringReason for changing the guild's name

Returns: Promise<Guild>

js
// Edit the guild name
guild.setName('Discord Guild')
 .then(updated => console.log(`Updated guild name to ${updated.name}`))
 .catch(console.error);

Source

setVerificationLevel ​

setVerificationLevel(verificationLevel: VerificationLevel | number, reason?: string): Promise<Guild>

Edits the verification level of the guild. Parameters

NameTypeDescription
verificationLevelVerificationLevel | numberThe new verification level of the guild
reason?stringReason for changing the guild's verification level

Returns: Promise<Guild>

js
// Edit the guild verification level
guild.setVerificationLevel(1)
 .then(updated => console.log(`Updated guild verification level to ${guild.verificationLevel}`))
 .catch(console.error);

Source

setAFKChannel ​

setAFKChannel(afkChannel: VoiceChannelResolvable, reason?: string): Promise<Guild>

Edits the AFK channel of the guild. Parameters

NameTypeDescription
afkChannelVoiceChannelResolvableThe new AFK channel
reason?stringReason for changing the guild's AFK channel

Returns: Promise<Guild>

js
// Edit the guild AFK channel
guild.setAFKChannel(channel)
 .then(updated => console.log(`Updated guild AFK channel to ${guild.afkChannel.name}`))
 .catch(console.error);

Source

setSystemChannel ​

setSystemChannel(systemChannel: TextChannelResolvable, reason?: string): Promise<Guild>

Edits the system channel of the guild. Parameters

NameTypeDescription
systemChannelTextChannelResolvableThe new system channel
reason?stringReason for changing the guild's system channel

Returns: Promise<Guild>

js
// Edit the guild system channel
guild.setSystemChannel(channel)
 .then(updated => console.log(`Updated guild system channel to ${guild.systemChannel.name}`))
 .catch(console.error);

Source

setAFKTimeout ​

setAFKTimeout(afkTimeout: number, reason?: string): Promise<Guild>

Edits the AFK timeout of the guild. Parameters

NameTypeDescription
afkTimeoutnumberThe time in seconds that a user must be idle to be considered AFK
reason?stringReason for changing the guild's AFK timeout

Returns: Promise<Guild>

js
// Edit the guild AFK channel
guild.setAFKTimeout(60)
 .then(updated => console.log(`Updated guild AFK timeout to ${guild.afkTimeout}`))
 .catch(console.error);

Source

setIcon ​

setIcon(icon: Base64Resolvable | BufferResolvable, reason?: string): Promise<Guild>

Sets a new guild icon. Parameters

NameTypeDescription
iconBase64Resolvable | BufferResolvableThe new icon of the guild
reason?stringReason for changing the guild's icon

Returns: Promise<Guild>

js
// Edit the guild icon
guild.setIcon('./icon.png')
 .then(updated => console.log('Updated the guild icon'))
 .catch(console.error);

Source

setOwner ​

setOwner(owner: GuildMemberResolvable, reason?: string): Promise<Guild>

Sets a new owner of the guild. Parameters

NameTypeDescription
ownerGuildMemberResolvableThe new owner of the guild
reason?stringReason for setting the new owner

Returns: Promise<Guild>

js
// Edit the guild owner
guild.setOwner(guild.members.cache.first())
 .then(guild => guild.fetchOwner())
 .then(owner => console.log(`Updated the guild owner to ${owner.displayName}`))
 .catch(console.error);

Source

setSplash ​

setSplash(splash: Base64Resolvable | BufferResolvable, reason?: string): Promise<Guild>

Sets a new guild invite splash image. Parameters

NameTypeDescription
splashBase64Resolvable | BufferResolvableThe new invite splash image of the guild
reason?stringReason for changing the guild's invite splash image

Returns: Promise<Guild>

js
// Edit the guild splash
guild.setSplash('./splash.png')
 .then(updated => console.log('Updated the guild splash'))
 .catch(console.error);

Source

setDiscoverySplash ​

setDiscoverySplash(discoverySplash: Base64Resolvable | BufferResolvable, reason?: string): Promise<Guild>

Sets a new guild discovery splash image. Parameters

NameTypeDescription
discoverySplashBase64Resolvable | BufferResolvableThe new discovery splash image of the guild
reason?stringReason for changing the guild's discovery splash image

Returns: Promise<Guild>

js
// Edit the guild discovery splash
guild.setDiscoverySplash('./discoverysplash.png')
  .then(updated => console.log('Updated the guild discovery splash'))
  .catch(console.error);

Source

setBanner ​

setBanner(banner: Base64Resolvable | BufferResolvable, reason?: string): Promise<Guild>

Sets a new guild banner. Parameters

NameTypeDescription
bannerBase64Resolvable | BufferResolvableThe new banner of the guild
reason?stringReason for changing the guild's banner

Returns: Promise<Guild>

js
guild.setBanner('./banner.png')
 .then(updated => console.log('Updated the guild banner'))
 .catch(console.error);

Source

setRulesChannel ​

setRulesChannel(rulesChannel: TextChannelResolvable, reason?: string): Promise<Guild>

Edits the rules channel of the guild. Parameters

NameTypeDescription
rulesChannelTextChannelResolvableThe new rules channel
reason?stringReason for changing the guild's rules channel

Returns: Promise<Guild>

js
// Edit the guild rules channel
guild.setRulesChannel(channel)
 .then(updated => console.log(`Updated guild rules channel to ${guild.rulesChannel.name}`))
 .catch(console.error);

Source

setPublicUpdatesChannel ​

setPublicUpdatesChannel(publicUpdatesChannel: TextChannelResolvable, reason?: string): Promise<Guild>

Edits the community updates channel of the guild. Parameters

NameTypeDescription
publicUpdatesChannelTextChannelResolvableThe new community updates channel
reason?stringReason for changing the guild's community updates channel

Returns: Promise<Guild>

js
// Edit the guild community updates channel
guild.setPublicUpdatesChannel(channel)
 .then(updated => console.log(`Updated guild community updates channel to ${guild.publicUpdatesChannel.name}`))
 .catch(console.error);

Source

setPreferredLocale ​

setPreferredLocale(preferredLocale: string, reason?: string): Promise<Guild>

Edits the preferred locale of the guild. Parameters

NameTypeDescription
preferredLocalestringThe new preferred locale of the guild
reason?stringReason for changing the guild's preferred locale

Returns: Promise<Guild>

js
// Edit the guild preferred locale
guild.setPreferredLocale('en-US')
 .then(updated => console.log(`Updated guild preferred locale to ${guild.preferredLocale}`))
 .catch(console.error);

Source

setSafetyAlertsChannel ​

setSafetyAlertsChannel(safetyAlertsChannel: TextChannelResolvable, reason?: string): Promise<Guild>

Edits the safety alerts channel of the guild. Parameters

NameTypeDescription
safetyAlertsChannelTextChannelResolvableThe new safety alerts channel
reason?stringReason for changing the guild's safety alerts channel

Returns: Promise<Guild>

js
// Edit the guild safety alerts channel
guild.setSafetyAlertsChannel(channel)
 .then(updated => console.log(`Updated guild safety alerts channel to ${updated.safetyAlertsChannel.name}`))
 .catch(console.error);

Source

setPremiumProgressBarEnabled ​

setPremiumProgressBarEnabled(enabled?: boolean, reason?: string): Promise<Guild>

Edits the enabled state of the guild's premium progress bar Parameters

NameTypeDescription
enabled?booleanThe new enabled state of the guild's premium progress bar Default: true.
reason?stringReason for changing the state of the guild's premium progress bar

Returns: Promise<Guild>Source

setChannelPositions ​

deprecated

setChannelPositions(channelPositions: Array<ChannelPosition>): Promise<Guild>

Batch-updates the guild's channels' positions. Only one channel's parent can be changed at a time Parameters

NameTypeDescription
channelPositionsArray<ChannelPosition>Channel positions to update

Returns: Promise<Guild>

js
guild.setChannelPositions([{ channel: channelId, position: newChannelIndex }])
  .then(guild => console.log(`Updated channel positions for ${guild}`))
  .catch(console.error);

Source

setRolePositions ​

deprecated

setRolePositions(rolePositions: Array<GuildRolePosition>): Promise<Guild>

Batch-updates the guild's role positions Parameters

NameTypeDescription
rolePositionsArray<GuildRolePosition>Role positions to update

Returns: Promise<Guild>

js
guild.setRolePositions([{ role: roleId, position: updatedRoleIndex }])
 .then(guild => console.log(`Role positions updated for ${guild}`))
 .catch(console.error);

Source

setWidgetSettings ​

async

async setWidgetSettings(settings: GuildWidgetSettingsData, reason?: string): Promise<Guild>

Edits the guild's widget settings. Parameters

NameTypeDescription
settingsGuildWidgetSettingsDataThe widget settings for the guild
reason?stringReason for changing the guild's widget settings

Returns: Promise<Guild>Source

disableInvites ​

disableInvites(disabled?: boolean): Promise<Guild>

Sets whether this guild's invites are disabled. Parameters

NameTypeDescription
disabled?booleanWhether the invites are disabled Default: true.

Returns: Promise<Guild>Source

setIncidentActions ​

setIncidentActions(incidentActions: IncidentActionsEditOptions): Promise<IncidentActions>

Sets the incident actions for a guild. Parameters

NameTypeDescription
incidentActionsIncidentActionsEditOptionsThe incident actions to set

Returns: Promise<IncidentActions>Source

leave ​

async

async leave(): Promise<Guild>

Leaves the guild. Returns: Promise<Guild>

js
// Leave a guild
guild.leave()
  .then(guild => console.log(`Left the guild: ${guild.name}`))
  .catch(console.error);

Source

delete ​

async

async delete(): Promise<Guild>

Deletes the guild. Returns: Promise<Guild>

js
// Delete a guild
guild.delete()
  .then(g => console.log(`Deleted the guild ${g}`))
  .catch(console.error);

Source

equals ​

equals(guild: 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. Parameters

NameTypeDescription
guildGuildThe guild to compare with

Returns: booleanSource

markAsRead ​

markAsRead(): Promise<void>

Marks the guild as read. Returns: Promise<void>

js
const guild = client.guilds.cache.get('id');
guild.markAsRead();

Source

setCommunity ​

async

async setCommunity(stats: boolean, publicUpdatesChannel?: GuildTextChannelResolvable, rulesChannel?: GuildTextChannelResolvable, reason?: string): Promise<Guild>

Set Community Feature. Parameters

NameTypeDescription
statsbooleanTrue / False to enable / disable Community Feature Default: true.
publicUpdatesChannel?GuildTextChannelResolvableThe community updates channel of the guild
rulesChannel?GuildTextChannelResolvableThe new rules channel
reason?stringReason for changing the community feature

Returns: Promise<Guild>Source

topEmojis ​

topEmojis(): Promise<Collection<number, GuildEmoji>>

Get the top emojis of this guild. Returns: Promise<Collection<number, GuildEmoji>>Source

setVanityCode ​

async

async setVanityCode(code?: string): Promise<Vanity>

Set the vanity URL to this guild. Resolves with an object containing the vanity URL invite code and the use count. Parameters

NameTypeDescription
code?stringVanity URL code Default: ''.

Returns: Promise<Vanity>

js
// Set invite code
guild.setVanityCode('elysia', '123456')
  .then(res => {
    console.log(`Vanity URL: https://discord.gg/${res.code} with ${res.uses} uses`);
  })
  .catch(console.error);

Source

requestChannelInfo ​

requestChannelInfo(fields?: Array<('status'|'voice_start_time')>): Guild

Requests ephemeral voice channel information for this guild. Discord responds with a CHANNEL_INFO Gateway dispatch. Parameters

NameTypeDescription
fields?Array<('status'|'voice_start_time')>Fields to request

Returns: GuildSource

_sortedRoles ​

private

_sortedRoles(): Collection<Snowflake, Role>

Creates a collection of this guild's roles, sorted by their position and ids. Returns: Collection<Snowflake, Role>Source

_sortedChannels ​

private

_sortedChannels(channel?: GuildChannel): Collection<Snowflake, GuildChannel>

Creates a collection of this guild's or a specific category's channels, sorted by their position and ids. Parameters

NameTypeDescription
channel?GuildChannelCategory to get the channels of

Returns: Collection<Snowflake, GuildChannel>Source

bannerURL ​

bannerURL(options?: StaticImageURLOptions): string

The URL to this guild's banner. Parameters

NameTypeDescription
options?StaticImageURLOptionsOptions for the Image URL Default: {}.

Returns: stringSource

splashURL ​

splashURL(options?: StaticImageURLOptions): string

The URL to this guild's invite splash image. Parameters

NameTypeDescription
options?StaticImageURLOptionsOptions for the Image URL Default: {}.

Returns: stringSource

iconURL ​

iconURL(options?: ImageURLOptions): string

The URL to this guild's icon. Parameters

NameTypeDescription
options?ImageURLOptionsOptions for the Image URL Default: {}.

Returns: stringSource

fetch ​

async

async fetch(): Promise<Guild>

Fetches this guild. Returns: Promise<Guild>Source

toString ​

toString(): string

When concatenated with a string, this automatically returns the guild's name instead of the Guild object. Returns: stringSource

Unofficial software. Not affiliated with or supported by Discord.