Class Guild

Represents a Discord server.

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

Properties

afkChannel?: null | VoiceChannel

This guild's afk voice channel.

afkChannelID: null | string

The ID of this guild's afk voice channel.

afkTimeout: number

The seconds after which voice users will be moved to the afk channel.

application?: null | ClientApplication

The application that created this guild, if applicable.

applicationID: null | string

The ID of the application that created this guild, if applicable.

approximateMemberCount?: number

The approximate number of members in this guild (if retrieved with counts).

approximatePresenceCount?: number

The approximate number of non-offline members in this guild (if retrieved with counts).

auditLogEntries: TypedCollection<string, RawAuditLogEntry, AuditLogEntry, []>

The cached audit log entries. This requires both the GUILD_MODERATION intent, as well as the Constants~Permissions.VIEW_AUDIT_LOG | VIEW_AUDIT_LOG permission.

autoModerationRules: TypedCollection<string, RawAutoModerationRule, AutoModerationRule, []>

The auto moderation rules in this guild.

banner: null | string

The hash of this guild's banner.

The channels in this guild.

defaultMessageNotifications: DefaultMessageNotificationLevels

The default message notifications level of this guild.

description: null | string

The description of this guild.

discoverySplash: null | string

The discovery splash of this guild. Only present if the guild has the DISCOVERABLE feature.

emojis: GuildEmoji[]

The custom emojis of this guild.

explicitContentFilter: ExplicitContentFilterLevels

The explicit content filter of this guild.

features: ("APPLICATION_COMMAND_PERMISSIONS_V2" | "ANIMATED_BANNER" | "ANIMATED_ICON" | "AUTO_MODERATION" | "BANNER" | "BOT_DEVELOPER_EARLY_ACCESS" | "COMMUNITY" | "CREATOR_MONETIZABLE" | "CREATOR_MONETIZABLE_DISABLED" | "CREATOR_MONETIZABLE_PROVISIONAL" | "CREATOR_STORE_PAGE" | "DEVELOPER_SUPPORT_SERVER" | "DISCOVERABLE" | "DISCOVERABLE_DISABLED" | "ENABLED_DISCOVERABLE_BEFORE" | "EXPOSED_TO_ACTIVITIES_WTP_EXPERIMENT" | "FEATURABLE" | "GUILD_HOME_TEST" | "HAD_EARLY_ACTIVITIES_ACCESS" | "HAS_DIRECTORY_ENTRY" | "HUB" | "INCREASED_THREAD_LIMIT" | "INTERNAL_EMPLOYEE_ONLY" | "INVITES_DISABLED" | "INVITE_SPLASH" | "LINKED_TO_HUB" | "MEMBER_PROFILES" | "MEMBER_VERIFICATION_GATE_ENABLED" | "MONETIZATION_ENABLED" | "MORE_EMOJI" | "MORE_EMOJIS" | "MORE_STICKERS" | "NEWS" | "NEW_THREAD_PERMISSIONS" | "PARTNERED" | "PREVIEW_ENABLED" | "PREVIOUSLY_DISCOVERABLE" | "PRIVATE_THREADS" | "RAID_ALERTS_ENABLED" | "ROLE_ICONS" | "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE" | "ROLE_SUBSCRIPTIONS_ENABLED" | "SEVEN_DAY_THREAD_ARCHIVE" | "TEXT_IN_VOICE_ENABLED" | "THREADS_ENABLED" | "THREADS_ENABLED_TESTING" | "THREE_DAY_THREAD_ARCHIVE" | "TICKETED_EVENTS_ENABLED" | "VANITY_URL" | "VERIFIED" | "VIP_REGIONS" | "WELCOME_SCREEN_ENABLED")[]

The features this guild has.

icon: null | string

The icon hash of this guild.

id: string
integrations: TypedCollection<string, RawIntegration, Integration, [guildID?: string]>

The integrations in this guild.

invites: Collection<string, Invite<"withMetadata", Uncached | InviteChannel>>

The cached invites in this guild. This will only be populated by invites created while the client is active.

joinedAt: null | Date

The date at which this guild was joined.

large: boolean

If this guild is considered large.

maxMembers?: number

The maximum amount of members this guild can have.

maxPresences?: number

The maximum amount of people that can be present at a time in this guild. Only present for very large guilds.

maxStageVideoChannelUsers?: number

The maximum amount of users that can be present in a stage video channel.

maxVideoChannelUsers?: number

The maximum amount of users that can be present in a video channel.

memberCount: number

The number of members in this guild.

members: TypedCollection<string, RawMember | RESTMember, Member, [guildID: string]>

The cached members in this guild.

mfaLevel: MFALevels

The required mfa level for moderators of this guild.

name: string

The name of this guild.

nsfwLevel: GuildNSFWLevels

The nsfw level of this guild.

owner?: User

The owner of this guild.

ownerID: string

The ID of the owner of this guild.

preferredLocale: string

The preferred locale of this guild.

premiumProgressBarEnabled: boolean

If this guild has the boost progress bar enabled.

premiumSubscriptionCount?: number

The number of nitro boosts this guild has.

premiumTier: PremiumTiers

The boost level of this guild.

publicUpdatesChannel?: null | AnyGuildTextChannel

The channel where notices from Discord are received. Only present in guilds with the COMMUNITY feature.

publicUpdatesChannelID: null | string

The id of the channel where notices from Discord are received. Only present in guilds with the COMMUNITY feature.

region?: null | string

Deprecated

The region of this guild.

roles: TypedCollection<string, RawRole, Role, [guildID: string]>

The roles in this guild.

rulesChannel?: null | TextChannel

The channel where rules/guidelines are displayed. Only present in guilds with the COMMUNITY feature.

rulesChannelID: null | string

The id of the channel where rules/guidelines are displayed. Only present in guilds with the COMMUNITY feature.

safetyAlertsChannel?: null | TextChannel

The channel where safety related notices are posted.

safetyAlertsChannelID: null | string

The ID if the channel where safety related notices are posted.

The scheduled events in this guild.

splash: null | string

The invite splash hash of this guild.

stageInstances: TypedCollection<string, RawStageInstance, StageInstance, []>

The stage instances in this guild.

stickers: Sticker[]

The custom stickers of this guild.

systemChannel?: null | TextChannel

The channel where welcome messages and boosts notices are posted.

systemChannelFlags: number

The flags for the system channel.

systemChannelID: null | string

The ID of the channel where welcome messages and boosts notices are posted.

The threads in this guild.

unavailable: boolean

If this guild is unavailable.

vanityURLCode: null | string

The vanity url of this guild. Only present in guilds with the VANITY_URL feature.

verificationLevel: VerificationLevels

The verification level of this guild.

voiceStates: TypedCollection<string, RawVoiceState, VoiceState, []>

The voice states of members in voice channels.

welcomeScreen?: WelcomeScreen

The welcome screen configuration. Only present in guilds with the WELCOME_SCREEN_ENABLED feature.

The channel the widget will generate an invite to, or null if set to no invite.

widgetChannelID: null | string

The id of the channel the widget will generate an invite to, or null if set to no invite.

widgetEnabled?: boolean

If the widget is enabled.

Accessors

  • get clientMember(): Member
  • The client's member for this guild. This will throw an error if the guild was obtained via rest and the member is not cached.

    Returns Member

  • get voiceAdapterCreator(): DiscordGatewayAdapterCreator
  • The voice adapter creator for this guild that can be used with @discordjs/voice to play audio in voice and stage channels.

    Returns DiscordGatewayAdapterCreator

Methods

  • Add a member to this guild. Requires an access token with the guilds.join scope.

    Returns the newly added member upon success, or void if the member is already in the guild.

    Parameters

    • userID: string

      The ID of the user to add.

    • options: AddMemberOptions

      The options for adding the member.

    Returns Promise<void | Member>

  • Add a role to a member.

    Parameters

    • memberID: string

      The ID of the member.

    • roleID: string

      The ID of the role to add.

    • Optional reason: string

      The reason for adding the role.

    Returns Promise<void>

  • The url of this guild's banner.

    Parameters

    • Optional format: "jpg" | "jpeg" | "png" | "webp" | "gif"

      The format the url should be.

    • Optional size: number

      The dimensions of the image.

    Returns null | string

  • Delete an auto moderation rule in this guild.

    Parameters

    • ruleID: string

      The ID of the rule to delete.

    • Optional reason: string

      The reason for deleting the rule.

    Returns Promise<void>

  • Delete an emoji in this guild.

    Parameters

    • emojiID: string

      The ID of the emoji.

    • Optional reason: string

      The reason for deleting the emoji.

    Returns Promise<void>

  • Delete an integration.

    Parameters

    • integrationID: string

      The ID of the integration.

    • Optional reason: string

      The reason for deleting the integration.

    Returns Promise<void>

  • Delete a role.

    Parameters

    • roleID: string

      The ID of the role to delete.

    • Optional reason: string

      The reason for deleting the role.

    Returns Promise<void>

  • Delete a scheduled event.

    Parameters

    • eventID: string

      The ID of the scheduled event.

    • Optional reason: string

      The reason for deleting the scheduled event. Discord's docs do not explicitly state a reason can be provided, so it may not be used.

    Returns Promise<void>

  • Delete a sticker.

    Parameters

    • stickerID: string

      The ID of the sticker to delete.

    • Optional reason: string

      The reason for deleting the sticker.

    Returns Promise<void>

  • Delete a template.

    Parameters

    • code: string

      The code of the template.

    Returns Promise<void>

  • Disable the COMMUNITY feature for this guild. Requires the Administrator permission.

    Parameters

    • Optional reason: string

      The reason for disable the feature.

    Returns Promise<Guild>

  • Disable the DISCOVERABLE feature for this guild. Requires the Administrator permission.

    Parameters

    • Optional reason: string

      The reason for disabling the feature.

    Returns Promise<Guild>

  • Disable the INVITES_DISABLED feature for this guild. Requires the Manage Guild permission.

    Parameters

    • Optional reason: string

      The reason for disabling the feature.

    Returns Promise<Guild>

  • Disable the RAID_ALERTS_ENABLED feature for this guild. Requires the Manage Guild permission.

    Parameters

    • Optional reason: string

      The reason for disabling the feature.

    Returns Promise<Guild>

  • The url of this guild's discovery splash.

    Parameters

    • Optional format: "jpg" | "jpeg" | "png" | "webp" | "gif"

      The format the url should be.

    • Optional size: number

      The dimensions of the image.

    Returns null | string

  • Edit a member of this guild. Use <Guild>.editCurrentMember if you wish to update the nick of this client using the CHANGE_NICKNAME permission.

    Parameters

    • memberID: string

      The ID of the member.

    • options: EditMemberOptions

      The options for editing the member.

    Returns Promise<Member>

  • Enable the COMMUNITY feature for this guild. Requires the Administrator permission.

    Parameters

    • Optional reason: string

      The reason for enabling the feature.

    Returns Promise<Guild>

  • Enable the DISCOVERABLE feature for this guild. Requires the Administrator permission. The server must also be passing all discovery requirements.

    Parameters

    • Optional reason: string

      The reason for enabling the feature.

    Returns Promise<Guild>

  • Enable the INVITES_DISABLED feature for this guild. Requires the Manage Guild permission.

    Parameters

    • Optional reason: string

      The reason for enabling the feature.

    Returns Promise<Guild>

  • Enable the RAID_ALERTS_ENABLED feature for this guild. Requires the Manage Guild permission.

    Parameters

    • Optional reason: string

      The reason for enabling the feature.

    Returns Promise<Guild>

  • Get a ban in this guild.

    Parameters

    • userID: string

      The ID of the user to get the ban of.

    Returns Promise<Ban>

  • Get a scheduled event.

    Parameters

    • eventID: string

      The ID of the scheduled event to get.

    • Optional withUserCount: number

      If the number of users subscribed to the event should be included.

    Returns Promise<GuildScheduledEvent>

  • Get a sticker. Response will include a user if the client has the MANAGE_EMOJIS_AND_STICKERS permissions.

    Parameters

    • stickerID: string

      The ID of the sticker to get.

    Returns Promise<Sticker>

  • Get this guild's stickers. Stickers will include a user if the client has the MANAGE_EMOJIS_AND_STICKERS permissions.

    Returns Promise<Sticker[]>

  • The url of this guild's icon.

    Parameters

    • Optional format: "jpg" | "jpeg" | "png" | "webp" | "gif"

      The format the url should be.

    • Optional size: number

      The dimensions of the image.

    Returns null | string

  • Remove a ban.

    Parameters

    • userID: string

      The ID of the user to remove the ban from.

    • Optional reason: string

      The reason for removing the ban.

    Returns Promise<void>

  • Remove a member from this guild.

    Parameters

    • memberID: string

      The ID of the user to remove.

    • Optional reason: string

      The reason for the removal.

    Returns Promise<void>

  • remove a role from a member.

    Parameters

    • memberID: string

      The ID of the member.

    • roleID: string

      The ID of the role to remove.

    • Optional reason: string

      The reason for removing the role.

    Returns Promise<void>

  • The url of this guild's invite splash.

    Parameters

    • Optional format: "jpg" | "jpeg" | "png" | "webp" | "gif"

      The format the url should be.

    • Optional size: number

      The dimensions of the image.

    Returns null | string