-
Notifications
You must be signed in to change notification settings - Fork 149
Guild
extends Snowflake
Represents a Discord guild (or server). Guilds are a collection of members, channels, and roles that represents one community.
Asynchronously loads all members for this guild. You do not need to call this
if the cacheAllMembers client option (and the syncGuilds option for
user-accounts) is enabled on start-up.
Asynchronously loads certain data and enables the receiving of certain events
for this guild. You do not need to call this if the syncGuilds client option
is enabled on start-up.
Note: This is only for user accounts. Bot accounts never need to sync guilds!
- id: User ID Resolveable
Gets a member object by ID. If the object is already cached, then the cached object will be returned; otherwise, an HTTP request is made.
- id: Role ID Resolveable
Gets a role object by ID.
- id: Channel ID Resolveable
Gets a text, voice, or category channel object by ID.
- name: string
Creates a new text channel in this guild. The name must be between 2 and 100 characters in length.
- name: string
Creates a new voice channel in this guild. The name must be between 2 and 100 characters in length.
- name: string
Creates a channel category in this guild. The name must be between 2 and 100 characters in length.
- name: string
Creates a new role in this guild. The name must be between 1 and 100 characters in length.
- name: string
Sets the guilds name. This must be between 2 and 100 characters in length.
- region: string
Sets the guild's voice region (eg: us-east). See listVoiceRegions for a list
of acceptable regions.
- verificationLevel: number
Sets the guild's verification level setting. See the verificationLevel
enumeration for acceptable values.
- notificationSetting: number
Sets the guild's default notification setting. See the notficationSetting
enumeration for acceptable values.
- explicitContentSetting: number
Sets the guild's explicit content level setting. See the explicitContentLevel
enumeration for acceptable values.
- afkTimeout: number
Sets the guild's AFK timeout in seconds.
- id: Channel ID Resolveable
Sets the guild's AFK channel.
- id: User ID Resolveable
Transfers ownership of the guild to another user. Only the current guild owner can do this.
- icon: Base64 Resolveable
Sets the guild's icon. To remove the icon, pass nil.
- splash: Base64 Resolveable
Sets the guild's splash. To remove the splash, pass nil.
- days: number
Returns the number of members that would be pruned from the guild if a prune were to be executed.
- days: number
Prunes (removes) inactive, roleless members from the guild.
Returns a newly constructed cache of all ban objects for the guild. The cache is not automatically updated via gateway events, but the internally referenced user objects may be updated. You must call this method again to guarantee that the objects are up to date.
Returns a newly constructed cache of all invite objects for the guild. The cache and its objects are not automatically updated via gateway events. You must call this method again to get the updated objects.
Returns a newly constructed cache of all webhook objects for the guild. The cache and its objects are not automatically updated via gateway events. You must call this method again to get the updated objects.
Returns a raw data table that contains a list of available voice regions for this guild, as provided by Discord, with no additional parsing.
Removes the current user from the guild.
Permanently deletes the guild. This cannot be undone!
- id: User ID Resolveable
- reason: string
Kicks a user/member from the guild with an optional reason.
- id: User ID Resolveable
- reason: string
- days: number
Bans a user/member from the guild with an optional reason. The days parameter
is the number of days to consider when purging messages, up to 7.
- id: User ID Resolveable
- reason: string
Unbans a user/member from the guild with an optional reason.
The ID of the shard on which this guild is served. If only one shard is in operation, then this will always be 0.
The guild's name. This should be between 2 and 100 characters in length.
The hash for the guild's custom icon, if one is set.
The URL that can be used to view the guild's icon, if one is set.
The hash for the guild's custom splash image, if one is set. Only partnered guilds may have this.
The URL that can be used to view the guild's custom splash image, if one is set. Only partnered guilds may have this.
Whether the guild has an arbitrarily large amount of members. Guilds that are "large" will not initialize with all members.
The voice region that is used for all voice connections in the guild.
The guild's multi-factor (or two-factor) verification level setting. A value of 0 indicates that MFA is not required; a value of 1 indicates that MFA is required for administrative actions.
The date and time at which the current user joined the guild, represented as an ISO 8601 string plus microseconds when available.
The guild's voice AFK timeout in seconds.
Whether the guild is unavailable. If the guild is unavailable, then no property is guaranteed to exist except for this one and the guild's ID.
The total number of members that belong to this guild. This should always be greater than or equal to the total number of cached members.
The guild's verification level setting. See the verificationLevel
enumeration for a human-readable representation.
The guild's default notification setting. See the notficationSetting
enumeration for a human-readable representation.
The guild's explicit content level setting. See the explicitContentLevel
enumeration for a human-readable representation.
Raw table of VIP features that are enabled for the guild.
Equivalent to Guild.members:get(Guild.client.user.id).
Equivalent to Guild.members:get(Guild.ownerId).
The Snowflake ID of the guild member that owns the guild.
The Snowflake ID of the channel that is used for AFK members, if one is set.
Equivalent to Guild.voiceChannels:get(Guild.afkChannelId).
Equivalent to Guild.roles:get(Guild.id).
An iterable cache of all roles that exist in this guild. This includes the default everyone role.
An iterable cache of all emojis that exist in this guild. Note that standard unicode emojis are not found here; only custom emojis.
An iterable cache of all members that exist in this guild and have been
already loaded. If the cacheAllMembers client option (and the syncGuilds
option for user-accounts) is enabled on start-up, then all members will be
cached. Otherwise, offline members may not be cached. To access a member that
may exist, but is not cached, use Guild:getMember.
An iterable cache of all text channels that exist in this guild.
An iterable cache of all voice channels that exist in this guild.
An iterable cache of all channel categories that exist in this guild.