Skip to content
SinisterRectus edited this page Nov 15, 2016 · 43 revisions

Represents a Discord guild (also known as a server).

Objects Accessible via Caches

  • Channels
  • Members
  • Messages
  • Roles
  • TextChannels
  • VoiceChannels

Properties Inherited From Container

Name Type Mutable Description
client Client Client object to which the Discord object is known
parent * Parent Discord object

Properties Inherited From Snowflake

Name Type Mutable Description
createdAt number Unix time in seconds at which the object was created by Discord
id string Snowflake ID for the object
timestamp string ISO 8601 date and time at which the object was created by Discord

Class Properties

Name Type Mutable Description
afkChannel GuildVoiceChannel X Voice channel to where members are moved when they are AFK
afkTimeout number X AFK timeout in seconds
bannedUsers function Iterator for the banned users in the guild
channelCount number How many Channels are cached for the guild.
channels function Iterator for the guild's cached Channels.
defaultChannel GuildTextChannel The guild's default text channel
defaultRole Role The guild's '@everyone' role
icon string X Hash representing the guild's icon
iconUrl string URL that points to the guild's icon
invites function Iterator for the guild's invites (not cached)
joinedAt string Date and time at which the client joined the guild
large boolean Whether the guild has a lot of members
me Member The client's member object for this guild
memberCount number How many Members are cached for the guild.
members function Iterator for the guild's cached Members.
messageCount number How many Messages are cached for the guild.
messages function Iterator for the guild's cached Messages.
mfaLevel number Guild required MFA level
name string X Name of the guild
notificationsSetting number Default message notifications setting for members
owner Member X The member that owns the server
region string X String representing the guild's voice region
roleCount number How many Roles are cached for the guild.
roles function Iterator for the guild's cached Roles.
splash string Hash representing the guild's custom splash
textChannelCount number How many TextChannels are cached for the guild.
textChannels function Iterator for the guild's cached TextChannels.
totalMemberCount number How many members exist in the guild (can be different from cached memberCount)
unavailable boolean Whether the guild data is unavailable
verificationLevel number Guild verification level
vip boolean Whether the guild is featured by Discord
voiceChannelCount number How many VoiceChannels are cached for the guild.
voiceChannels function Iterator for the guild's cached VoiceChannels.

Class Methods

Prototype Description
banUser(user[, days]) Bans a user from the guild and optionally deletes their messages from 1-7 days.
createRole() Creates a new role in the guild.
createTextChannel(name) Creates a new text channel in the guild.
createVoiceChannel(name) Creates a new voice channel in the guild.
delete() Deletes the guild.
getPruneCount([days]) Returns how many members would be removed if 1-30 day prune were performed (default: 1 day).
kickUser(user) Kicks a user from the guild
leave() Leaves the guild.
listVoiceRegions() Returns a table of guild voice regions.
pruneMembers([days]) Removes members who have not been seen in 1-30 days (default: 1 day). Returns the number of pruned members.
unbanUser(user) Unbans a user from the guild.

Clone this wiki locally