Guild is a server (“guild” is the name Discord gives servers in its API). You get one as the guild of a command used in a server, with the events that happen in one, and as member.guild, role.guild or channel.guild.
Properties
How many members the server has. Exact when the bot receives member events, approximate otherwise;
null when Discord never said it.What the server has enabled or unlocked (
COMMUNITY, VANITY_URL…). See GuildFeature.What Discord asks of new members before they can write. See VerificationLevel.
The boost level of the server. See PremiumTier.
The language of the server, used for what Discord sends to it. See Locale.
The members of the server the bot knows: the ones seen the most recently, not all of them.
The bot in voice in this server, to play or leave;
null when it is in no voice channel here. See VoiceConnection.members only holds the members the bot has seen lately (see Memory). Use fetchMember() to get one for sure. me is always there, whatever the bot remembers.Helpers
These read what the bot remembers: they never send a request.iconURL()
bannerURL()
splashURL()
toString()
toJSON()
Reading from Discord
fetch()
fetchMember()
fetchMembers()
limit is a whole number between 1 and 1000 (the default); after is the id of the last member of the previous page.
Discord documentation
searchMembers()
limit is 1 by default.
Discord documentation
fetchOwner()
fetchBan()
null when they are not banned. See Ban.
Discord documentation
fetchBans()
fetchRoles()
fetchChannels()
fetchActiveThreads()
fetchEmojis()
fetchInvites()
fetchWebhooks()
fetchAuditLog()
fetchScheduledEvents()
fetchAutoModerationRules()
fetchStickers()
Actions
edit()
leave()
kick()
ban()
bulkBan()
unban()
createRole()
createChannel()
createEmoji()
options.image is the image as a data URI (data:image/png;base64,...).
Discord documentation
createScheduledEvent()
Types
GuildFeature
What a server has enabled or unlocked, as Discord names it: one of'ANIMATED_BANNER', 'ANIMATED_ICON', 'APPLICATION_COMMAND_PERMISSIONS_V2', 'AUTO_MODERATION', 'BANNER', 'COMMUNITY', 'CREATOR_MONETIZABLE_PROVISIONAL', 'CREATOR_STORE_PAGE', 'DEVELOPER_SUPPORT_SERVER', 'DISCOVERABLE', 'ENHANCED_ROLE_COLORS', 'FEATURABLE', 'GUILD_TAGS', 'GUESTS_ENABLED', 'INVITES_DISABLED', 'INVITE_SPLASH', 'MEMBER_VERIFICATION_GATE_ENABLED', 'MORE_SOUNDBOARD', 'MORE_STICKERS', 'NEWS', 'PARTNERED', 'PREVIEW_ENABLED', 'PRUNE_REQUIRES_ADMIN', 'RAID_ALERTS_DISABLED', 'ROLE_ICONS', 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE', 'ROLE_SUBSCRIPTIONS_ENABLED', 'SOUNDBOARD', 'TICKETED_EVENTS_ENABLED', 'VANITY_URL', 'VERIFIED', 'VIP_REGIONS', 'WELCOME_SCREEN_ENABLED'.
Discord adds features over time, so any other text is accepted too: guild.features.includes('COMMUNITY') is typed, and an unknown feature does not break anything.
Discord documentation
Audit log filters
WhatfetchAuditLog() takes. Every field can be left out.
Only the entries of this kind of action. See AuditLogEvent.
Scheduled event options
WhatcreateScheduledEvent() takes. Dates are ISO 8601 texts (date.toISOString()); the image is a data URI (data:image/png;base64,...).
Where the event takes place:
1 in a stage channel, 2 in a voice channel, 3 somewhere else (entityMetadata.location then says where).The entity metadata of the scheduled event:
location is where it takes place (1-100 characters).Other types
GuildEditOptions,ChannelCreateOptionsandRoleCreateOptionsare in Options.AuditLog,AutoModerationRule,Ban,ScheduledEventandStickerare in Data.BanOptionsis in GuildMember.