Constructor
new Guild(client, data)
Parameters:
Name | Type | Description |
---|---|---|
client |
Client | The instantiating client |
data |
Object | The data for the guild |
- Source:
Extends
Members
(readonly, nullable) afkChannel :VoiceChannel
AFK voice channel for this guild
Type:
- Source:
(nullable) afkChannelID :Snowflake
The ID of the voice channel where AFK members are moved
Type:
- Source:
(nullable) afkTimeout :number
The time in seconds before a user is counted as "away from keyboard"
Type:
- number
- Source:
(nullable) applicationID :Snowflake
The ID of the application that created this guild (if applicable)
Type:
- Source:
(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
Type:
- number
- Source:
(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
Type:
- number
- Source:
available :boolean
Whether the guild is available to access. If it is not available, it indicates a server outage
Type:
- boolean
- Source:
(nullable) banner :string
The hash of the guild banner
Type:
- string
- Source:
channels :GuildChannelManager
A manager of the channels belonging to this guild
Type:
- Source:
(readonly) client :Client
The client that instantiated this
Type:
- Overrides:
- Source:
(readonly) createdAt :Date
The time the guild was created at
Type:
- Date
- Source:
(readonly) createdTimestamp :number
The timestamp the guild was created at
Type:
- number
- Source:
defaultMessageNotifications :DefaultMessageNotifications|number
The value set for the guild's default message notifications
Type:
- DefaultMessageNotifications | number
- Source:
deleted :boolean
Whether the bot has been removed from the guild
Type:
- boolean
- Source:
(nullable) description :string
The description of the guild, if any
Type:
- string
- Source:
(nullable) discoverySplash :string
The hash of the guild discovery splash image
Type:
- string
- Source:
(readonly, nullable) embedChannel :TextChannel
Embed channel for this guild
Type:
- Deprecated:
- Yes
- Source:
(nullable) embedChannelID :string
The embed channel ID, if enabled
Type:
- string
- Deprecated:
- Yes
- Source:
embedEnabled :boolean
Whether embedded images are enabled on this guild
Type:
- boolean
- Deprecated:
- Yes
- Source:
emojis :GuildEmojiManager
A manager of the emojis belonging to this guild
Type:
- Source:
explicitContentFilter :ExplicitContentFilterLevel
The explicit content filter level of the guild
Type:
- Source:
features :Array.<Features>
An array of guild features partnered guilds have enabled
Type:
- Array.<Features>
- Source:
(nullable) icon :string
The hash of the guild icon
Type:
- string
- Source:
id :Snowflake
The Unique ID of the guild, useful for comparisons
Type:
- Source:
(readonly) joinedAt :Date
The time the client user joined the guild
Type:
- Date
- Source:
joinedTimestamp :number
The timestamp the client user joined the guild at
Type:
- number
- Source:
large :boolean
Whether the guild is "large" (has more than large_threshold members, 50 by default)
Type:
- boolean
- Source:
(nullable) maximumMembers :number
The maximum amount of members the guild can have
You will need to fetch the guild using Guild#fetch if you want to receive this parameter
Type:
- number
- Source:
(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
Type:
- number
- Source:
(readonly, nullable) me :GuildMember
The client user as a GuildMember of this guild
Type:
- Source:
memberCount :number
The full amount of members in this guild
Type:
- number
- Source:
members :GuildMemberManager
A manager of the members belonging to this guild
Type:
- Source:
mfaLevel :number
The required MFA level for the guild
Type:
- number
- Source:
name :string
The name of the guild
Type:
- string
- Source:
(readonly) nameAcronym :string
The acronym that shows up in place of a guild icon.
Type:
- string
- Source:
(readonly, nullable) owner :GuildMember
The owner of the guild
Type:
- Source:
ownerID :Snowflake
The user ID of this guild's owner
Type:
- Source:
(readonly) partnered :boolean
If this guild is partnered
Type:
- boolean
- Source:
preferredLocale :string
The preferred locale of the guild, defaults to `en-US`
Type:
- string
- Source:
(nullable) premiumSubscriptionCount :number
The total number of boosts for this server
Type:
- number
- Source:
premiumTier :PremiumTier
The premium tier on this guild
Type:
- Source:
presences :PresenceManager
A manager of the presences belonging to this guild
Type:
- Source:
(readonly, nullable) publicUpdatesChannel :TextChannel
Public updates channel for this guild
Type:
- Source:
(nullable) publicUpdatesChannelID :Snowflake
The ID of the community updates channel for the guild
Type:
- Source:
region :string
The region the guild is located in
Type:
- string
- Source:
roles :RoleManager
A manager of the roles belonging to this guild
Type:
- Source:
(readonly, nullable) rulesChannel :TextChannel
Rules channel for this guild
Type:
- Source:
(nullable) rulesChannelID :Snowflake
The ID of the rules channel for the guild
Type:
- Source:
(readonly) shard :WebSocketShard
The Shard this Guild belongs to.
Type:
- Source:
shardID :number
The id of the shard this Guild belongs to.
Type:
- number
- Source:
(nullable) splash :string
The hash of the guild invite splash image
Type:
- string
- Source:
(readonly, nullable) systemChannel :TextChannel
System channel for this guild
Type:
- Source:
systemChannelFlags :Readonly.<SystemChannelFlags>
The value set for the guild's system channel flags
Type:
- Readonly.<SystemChannelFlags>
- Source:
(nullable) systemChannelID :Snowflake
The ID of the system channel
Type:
- Source:
(nullable) vanityURLCode :string
The vanity invite code of the guild, if any
Type:
- string
- Source:
(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
Type:
- number
- Source:
verificationLevel :VerificationLevel
The verification level of the guild
Type:
- Source:
(readonly) verified :boolean
If this guild is verified
Type:
- boolean
- Source:
(readonly, nullable) voice :VoiceState
The voice state for the client user of this guild, if any
Type:
- Source:
voiceStates :VoiceStateManager
A manager of the voice states of this guild
Type:
- Source:
(readonly, nullable) widgetChannel :TextChannel
Widget channel for this guild
Type:
- Source:
(nullable) widgetChannelID :string
The widget channel ID, if enabled
Type:
- string
- Source:
(nullable) widgetEnabled :boolean
Whether widget images are enabled on this guild
Type:
- boolean
- Source:
Methods
(private) _patch(data)
Sets up the guild.
Parameters:
Name | Type | Description |
---|---|---|
data |
* | The raw data of the guild |
- Source:
(private) _sortedChannels(channelopt) → {Collection.<GuildChannel>}
Creates a collection of this guild's or a specific category's channels, sorted by their position and IDs.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
channel |
GuildChannel |
<optional> |
Category to get the channels of |
- Source:
Returns:
- Type
- Collection.<GuildChannel>
(private) _sortedRoles() → {Collection.<Role>}
Creates a collection of this guild's roles, sorted by their position and IDs.
- Source:
Returns:
- Type
- Collection.<Role>
addMember(user, options) → {Promise.<GuildMember>}
Adds a user to the guild using OAuth2. Requires the `CREATE_INSTANT_INVITE` permission.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
user |
UserResolvable | User to add to the guild | ||||||||||||||||||||||||
options |
Object | Options for the addition
Properties
|
- Source:
Returns:
- Type
- Promise.<GuildMember>
bannerURL(optionsopt) → {string}
The URL to this guild's banner.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
ImageURLOptions |
<optional> |
{} | Options for the Image URL |
- Source:
Returns:
- Type
- string
createIntegration(data, reason) → {Promise.<Guild>}
Creates an integration by attaching an integration object
Parameters:
Name | Type | Description |
---|---|---|
data |
IntegrationData | The data for the integration |
reason |
string | Reason for creating the integration |
- Source:
Returns:
- Type
- Promise.<Guild>
delete() → {Promise.<Guild>}
Deletes the guild.
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Delete a guild
guild.delete()
.then(g => console.log(`Deleted the guild ${g}`))
.catch(console.error);
discoverySplashURL(optionsopt) → {string}
The URL to this guild's discovery splash image.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
ImageURLOptions |
<optional> |
{} | Options for the Image URL |
- Source:
Returns:
- Type
- string
edit(data, reasonopt) → {Promise.<Guild>}
Updates the guild with new information - e.g. a new name.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
GuildEditData | The data to update the guild with | |
reason |
string |
<optional> |
Reason for editing this guild |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Set the guild name and region
guild.edit({
name: 'Discord Guild',
region: 'london',
})
.then(updated => console.log(`New guild name ${updated} in region ${updated.region}`))
.catch(console.error);
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.
Parameters:
Name | Type | Description |
---|---|---|
guild |
Guild | The guild to compare with |
- Source:
Returns:
- Type
- boolean
fetch() → {Promise.<Guild>}
Fetches this guild.
- Source:
Returns:
- Type
- Promise.<Guild>
fetchAuditLogs(optionsopt) → {Promise.<GuildAuditLogs>}
Fetches audit logs for this guild.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} | Options for fetching audit logs
Properties
|
- Source:
Returns:
- Type
- Promise.<GuildAuditLogs>
Example
// Output audit log entries
guild.fetchAuditLogs()
.then(audit => console.log(audit.entries.first()))
.catch(console.error);
fetchBan(user) → {Promise.<BanInfo>}
Fetches information on a banned user from this guild.
Parameters:
Name | Type | Description |
---|---|---|
user |
UserResolvable | The User to fetch the ban info of |
- Source:
Returns:
- Type
- Promise.<BanInfo>
fetchBans() → {Promise.<Collection.<Snowflake, BanInfo>>}
Fetches a collection of banned users in this guild.
- Source:
Returns:
fetchEmbed() → {Promise.<GuildWidget>}
Fetches the guild embed.
- Deprecated:
- Yes
- Source:
Returns:
- Type
- Promise.<GuildWidget>
Example
// Fetches the guild embed
guild.fetchEmbed()
.then(embed => console.log(`The embed is ${embed.enabled ? 'enabled' : 'disabled'}`))
.catch(console.error);
fetchIntegrations(optionsopt) → {Promise.<Collection.<string, Integration>>}
Fetches a collection of integrations to this guild.
Resolves with a collection mapping integrations by their ids.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Options for fetching integrations
Properties
|
- Source:
Returns:
- Type
- Promise.<Collection.<string, Integration>>
Example
// Fetch integrations
guild.fetchIntegrations()
.then(integrations => console.log(`Fetched ${integrations.size} integrations`))
.catch(console.error);
fetchInvites() → {Promise.<Collection.<string, Invite>>}
Fetches a collection of invites to this guild.
Resolves with a collection mapping invites by their codes.
- Source:
Returns:
- Type
- Promise.<Collection.<string, Invite>>
Examples
// Fetch invites
guild.fetchInvites()
.then(invites => console.log(`Fetched ${invites.size} invites`))
.catch(console.error);
// Fetch invite creator by their id
guild.fetchInvites()
.then(invites => console.log(invites.find(invite => invite.inviter.id === '84484653687267328')))
.catch(console.error);
fetchPreview() → {Promise.<GuildPreview>}
Obtains a guild preview for this guild from Discord.
- Source:
Returns:
- Type
- Promise.<GuildPreview>
fetchVanityCode() → {Promise.<string>}
Fetches the vanity url invite code to this guild.
Resolves with a string matching the vanity url invite code, not the full url.
- Deprecated:
- Yes
- Source:
Returns:
- Type
- Promise.<string>
Example
// Fetch invites
guild.fetchVanityCode()
.then(code => {
console.log(`Vanity URL: https://discord.gg/${code}`);
})
.catch(console.error);
(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
- Source:
Returns:
- Type
- Promise.<Vanity>
Example
// Fetch invite data
guild.fetchVanityData()
.then(res => {
console.log(`Vanity URL: https://discord.gg/${res.code} with ${res.uses} uses`);
})
.catch(console.error);
fetchVoiceRegions() → {Promise.<Collection.<string, VoiceRegion>>}
Fetches available voice regions.
- Source:
Returns:
- Type
- Promise.<Collection.<string, VoiceRegion>>
fetchWebhooks() → {Promise.<Collection.<Snowflake, Webhook>>}
Fetches all webhooks for the guild.
- Source:
Returns:
Example
// Fetch webhooks
guild.fetchWebhooks()
.then(webhooks => console.log(`Fetched ${webhooks.size} webhooks`))
.catch(console.error);
(async) fetchWidget() → {Promise.<GuildWidget>}
Fetches the guild widget.
- Source:
Returns:
- Type
- Promise.<GuildWidget>
Example
// Fetches the guild widget
guild.fetchWidget()
.then(widget => console.log(`The widget is ${widget.enabled ? 'enabled' : 'disabled'}`))
.catch(console.error);
iconURL(optionsopt) → {string}
The URL to this guild's icon.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
ImageURLOptions |
<optional> |
{} | Options for the Image URL |
- Source:
Returns:
- Type
- string
leave() → {Promise.<Guild>}
Leaves the guild.
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Leave a guild
guild.leave()
.then(g => console.log(`Left the guild ${g}`))
.catch(console.error);
member(user) → {GuildMember}
Returns the GuildMember form of a User object, if the user is present in the guild.
Parameters:
Name | Type | Description |
---|---|---|
user |
UserResolvable | The user that you want to obtain the GuildMember of |
- Source:
Returns:
- Type
- GuildMember
Example
// Get the guild member of a user
const member = guild.member(message.author);
setAFKChannel(afkChannel, reasonopt) → {Promise.<Guild>}
Edits the AFK channel of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
afkChannel |
ChannelResolvable | The new AFK channel | |
reason |
string |
<optional> |
Reason for changing the guild's AFK channel |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild AFK channel
guild.setAFKChannel(channel)
.then(updated => console.log(`Updated guild AFK channel to ${guild.afkChannel.name}`))
.catch(console.error);
setAFKTimeout(afkTimeout, reasonopt) → {Promise.<Guild>}
Edits the AFK timeout of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
afkTimeout |
number | The time in seconds that a user must be idle to be considered AFK | |
reason |
string |
<optional> |
Reason for changing the guild's AFK timeout |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild AFK channel
guild.setAFKTimeout(60)
.then(updated => console.log(`Updated guild AFK timeout to ${guild.afkTimeout}`))
.catch(console.error);
(async) setBanner(banner, reasonopt) → {Promise.<Guild>}
Sets a new guild banner.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
banner |
Base64Resolvable | BufferResolvable | The new banner of the guild | |
reason |
string |
<optional> |
Reason for changing the guild's banner |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
guild.setBanner('./banner.png')
.then(updated => console.log('Updated the guild banner'))
.catch(console.error);
setChannelPositions(channelPositions) → {Promise.<Guild>}
Batch-updates the guild's channels' positions.
Parameters:
Name | Type | Description |
---|---|---|
channelPositions |
Array.<ChannelPosition> | Channel positions to update |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
guild.setChannelPositions([{ channel: channelID, position: newChannelIndex }])
.then(guild => console.log(`Updated channel positions for ${guild}`))
.catch(console.error);
setDefaultMessageNotifications(defaultMessageNotifications, reasonopt) → {Promise.<Guild>}
Edits the setting of the default message notifications of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
defaultMessageNotifications |
DefaultMessageNotifications | number | The new setting for the default message notifications | |
reason |
string |
<optional> |
Reason for changing the setting of the default message notifications |
- Source:
Returns:
- Type
- Promise.<Guild>
(async) setDiscoverySplash(discoverySplash, reasonopt) → {Promise.<Guild>}
Sets a new guild discovery splash image.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
discoverySplash |
Base64Resolvable | BufferResolvable | The new discovery splash image of the guild | |
reason |
string |
<optional> |
Reason for changing the guild's discovery splash image |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild discovery splash
guild.setDiscoverySplash('./discoverysplash.png')
.then(updated => console.log('Updated the guild discovery splash'))
.catch(console.error);
setEmbed(embed, reasonopt) → {Promise.<Guild>}
Edits the guild's embed.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
embed |
GuildWidgetData | The embed for the guild | |
reason |
string |
<optional> |
Reason for changing the guild's embed |
- Deprecated:
- Yes
- Source:
Returns:
- Type
- Promise.<Guild>
setExplicitContentFilter(explicitContentFilter, reasonopt) → {Promise.<Guild>}
Edits the level of the explicit content filter.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
explicitContentFilter |
ExplicitContentFilterLevel | number | The new level of the explicit content filter | |
reason |
string |
<optional> |
Reason for changing the level of the guild's explicit content filter |
- Source:
Returns:
- Type
- Promise.<Guild>
(async) setIcon(icon, reasonopt) → {Promise.<Guild>}
Sets a new guild icon.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
icon |
Base64Resolvable | BufferResolvable | The new icon of the guild | |
reason |
string |
<optional> |
Reason for changing the guild's icon |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild icon
guild.setIcon('./icon.png')
.then(updated => console.log('Updated the guild icon'))
.catch(console.error);
setName(name, reasonopt) → {Promise.<Guild>}
Edits the name of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | The new name of the guild | |
reason |
string |
<optional> |
Reason for changing the guild's name |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild name
guild.setName('Discord Guild')
.then(updated => console.log(`Updated guild name to ${updated.name}`))
.catch(console.error);
setOwner(owner, reasonopt) → {Promise.<Guild>}
Sets a new owner of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
owner |
GuildMemberResolvable | The new owner of the guild | |
reason |
string |
<optional> |
Reason for setting the new owner |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild owner
guild.setOwner(guild.members.cache.first())
.then(updated => console.log(`Updated the guild owner to ${updated.owner.displayName}`))
.catch(console.error);
setPreferredLocale(preferredLocale, reasonopt) → {Promise.<Guild>}
Edits the preferred locale of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
preferredLocale |
string | The new preferred locale of the guild | |
reason |
string |
<optional> |
Reason for changing the guild's preferred locale |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild preferred locale
guild.setPreferredLocale('en-US')
.then(updated => console.log(`Updated guild preferred locale to ${guild.preferredLocale}`))
.catch(console.error);
setPublicUpdatesChannel(publicUpdatesChannel, reasonopt) → {Promise.<Guild>}
Edits the community updates channel of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
publicUpdatesChannel |
ChannelResolvable | The new community updates channel | |
reason |
string |
<optional> |
Reason for changing the guild's community updates channel |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// 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);
setRegion(region, reasonopt) → {Promise.<Guild>}
Edits the region of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
region |
string | The new region of the guild | |
reason |
string |
<optional> |
Reason for changing the guild's region |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild region
guild.setRegion('london')
.then(updated => console.log(`Updated guild region to ${updated.region}`))
.catch(console.error);
setRolePositions(rolePositions) → {Promise.<Guild>}
Batch-updates the guild's role positions
Parameters:
Name | Type | Description |
---|---|---|
rolePositions |
Array.<GuildRolePosition> | Role positions to update |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
guild.setRolePositions([{ role: roleID, position: updatedRoleIndex }])
.then(guild => console.log(`Role permissions updated for ${guild}`))
.catch(console.error);
setRulesChannel(rulesChannel, reasonopt) → {Promise.<Guild>}
Edits the rules channel of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
rulesChannel |
ChannelResolvable | The new rules channel | |
reason |
string |
<optional> |
Reason for changing the guild's rules channel |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild rules channel
guild.setRulesChannel(channel)
.then(updated => console.log(`Updated guild rules channel to ${guild.rulesChannel.name}`))
.catch(console.error);
(async) setSplash(splash, reasonopt) → {Promise.<Guild>}
Sets a new guild invite splash image.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
splash |
Base64Resolvable | BufferResolvable | The new invite splash image of the guild | |
reason |
string |
<optional> |
Reason for changing the guild's invite splash image |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild splash
guild.setSplash('./splash.png')
.then(updated => console.log('Updated the guild splash'))
.catch(console.error);
setSystemChannel(systemChannel, reasonopt) → {Promise.<Guild>}
Edits the system channel of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
systemChannel |
ChannelResolvable | The new system channel | |
reason |
string |
<optional> |
Reason for changing the guild's system channel |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild system channel
guild.setSystemChannel(channel)
.then(updated => console.log(`Updated guild system channel to ${guild.systemChannel.name}`))
.catch(console.error);
setSystemChannelFlags(systemChannelFlags, reasonopt) → {Promise.<Guild>}
Edits the flags of the default message notifications of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
systemChannelFlags |
SystemChannelFlagsResolvable | The new flags for the default message notifications | |
reason |
string |
<optional> |
Reason for changing the flags of the default message notifications |
- Source:
Returns:
- Type
- Promise.<Guild>
setVerificationLevel(verificationLevel, reasonopt) → {Promise.<Guild>}
Edits the verification level of the guild.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
verificationLevel |
VerificationLevel | number | The new verification level of the guild | |
reason |
string |
<optional> |
Reason for changing the guild's verification level |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Edit the guild verification level
guild.setVerificationLevel(1)
.then(updated => console.log(`Updated guild verification level to ${guild.verificationLevel}`))
.catch(console.error);
setWidget(widget, reasonopt) → {Promise.<Guild>}
Edits the guild's widget.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
widget |
GuildWidgetData | The widget for the guild | |
reason |
string |
<optional> |
Reason for changing the guild's widget |
- Source:
Returns:
- Type
- Promise.<Guild>
splashURL(optionsopt) → {string}
The URL to this guild's invite splash image.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
ImageURLOptions |
<optional> |
{} | Options for the Image URL |
- Source:
Returns:
- Type
- string
toString() → {string}
When concatenated with a string, this automatically returns the guild's name instead of the Guild object.
- Source:
Returns:
- Type
- string
Example
// Logs: Hello from My Guild!
console.log(`Hello from ${guild}!`);