Class Guild

Represents a Discord server.

Hierarchy (view full)

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).

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

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: SimpleCollection<string, RawGuildEmoji, GuildEmoji, "id">

The custom emojis of this guild.

explicitContentFilter: ExplicitContentFilterLevels

The explicit content filter of this guild.

features: ("ACTIVITIES_ALPHA" | "ACTIVITIES_EMPLOYEE" | "ACTIVITIES_INTERNAL_DEV" | "ANIMATED_BANNER" | "ANIMATED_ICON" | "APPLICATION_COMMAND_PERMISSIONS_V2" | "AUTO_MODERATION" | "AUTOMOD_TRIGGER_USER_PROFILE" | "BANNER" | "BOT_DEVELOPER_EARLY_ACCESS" | "BURST_REACTIONS" | "CHANNEL_HIGHLIGHTS_DISABLED" | "CHANNEL_HIGHLIGHTS" | "CHANNEL_ICON_EMOJIS_GENERATED" | "CLYDE_DISABLED" | "CLYDE_ENABLED" | "CLYDE_EXPERIMENT_ENABLED" | "COMMERCE" | "COMMUNITY_CANARY" | "COMMUNITY_EXP_LARGE_GATED" | "COMMUNITY_EXP_LARGE_UNGATED" | "COMMUNITY_EXP_MEDIUM" | "COMMUNITY" | "CREATOR_ACCEPTED_NEW_TERMS" | "CREATOR_MONETIZABLE_DISABLED" | "CREATOR_MONETIZABLE_PENDING_NEW_OWNER_ONBOARDING" | "CREATOR_MONETIZABLE_PROVISIONAL" | "CREATOR_MONETIZABLE_RESTRICTED" | "CREATOR_MONETIZABLE_WHITEGLOVE" | "CREATOR_MONETIZABLE" | "CREATOR_STORE_PAGE" | "DEVELOPER_SUPPORT_SERVER" | "DISCOVERABLE_DISABLED" | "DISCOVERABLE" | "ENABLED_DISCOVERABLE_BEFORE" | "ENABLED_MODERATION_EXPERIENCE_FOR_NON_COMMUNITY" | "EXPOSED_TO_ACTIVITIES_WTP_EXPERIMENT" | "FEATURABLE" | "GUESTS_ENABLED" | "GUILD_HOME_DEPRECATION_OVERRIDE" | "GUILD_HOME_OVERRIDE" | "GUILD_HOME_TEST" | "GUILD_ONBOARDING_EVER_ENABLED" | "GUILD_ONBOARDING_HAS_PROMPTS" | "GUILD_ONBOARDING" | "GUILD_ROLE_SUBSCRIPTION_TIER_TEMPLATE" | "GUILD_SERVER_GUIDE" | "GUILD_WEB_PAGE_VANITY_URL" | "HAD_EARLY_ACTIVITIES_ACCESS" | "HAS_DIRECTORY_ENTRY" | "HUB" | "INCREASED_THREAD_LIMIT" | "INTERNAL_EMPLOYEE_ONLY" | "INVITE_SPLASH" | "INVITES_DISABLED" | "LINKED_TO_HUB" | "MARKETPLACES_CONNECTION_ROLES" | "MEMBER_PROFILES" | "MEMBER_SAFETY_PAGE_ROLLOUT" | "MEMBER_VERIFICATION_GATE_ENABLED" | "MONETIZATION_ENABLED" | "MORE_EMOJI" | "MORE_EMOJIS" | "MORE_STICKERS" | "NEW_THREAD_PERMISSIONS" | "NEWS" | "NON_COMMUNITY_RAID_ALERTS" | "PARTNERED" | "PREVIEW_ENABLED" | "PREVIOUSLY_DISCOVERABLE" | "PRIVATE_THREADS" | "PRODUCTS_AVAILABLE_FOR_PURCHASE" | "RAID_ALERTS_DISABLED" | "RAID_ALERTS_ENABLED" | "ROLE_ICONS" | "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE" | "ROLE_SUBSCRIPTIONS_ENABLED" | "SEVEN_DAY_THREAD_ARCHIVE" | "SHARD" | "SOUNDBOARD" | "SUMMARIES_DISABLED_BY_USER" | "SUMMARIES_ENABLED_BY_USER" | "SUMMARIES_ENABLED_GA" | "SUMMARIES_ENABLED" | "SUMMARIES_OPT_OUT_EXPERIENCE" | "SUMMARIES_PAUSED" | "TEXT_IN_STAGE_ENABLED" | "TEXT_IN_VOICE_ENABLED" | "THREADS_ENABLED_TESTING" | "THREADS_ENABLED" | "THREE_DAY_THREAD_ARCHIVE" | "TICKETED_EVENTS_ENABLED" | "VANITY_URL" | "VERIFIED" | "VIP_REGIONS" | "VOICE_IN_THREADS" | "WELCOME_SCREEN_ENABLED")[]

The features this guild has.

icon: null | string

The icon hash of this guild.

id: string
incidentActions: null | IncidentActions
integrations: TypedCollection<RawIntegration, Integration, [guildID?: string]>

The integrations in this guild.

inventorySettings: null | InventorySettings

The guild's inventory settings.

invites: SimpleCollection<string, RawInvite, Invite<"withMetadata", AnyInviteChannel | Uncached>, "code">

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.

latestOnboardingQuestionID: null | string
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<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?: null | User

The owner of this guild.

ownerID: null | 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 | AnyTextableGuildChannel

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<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.

The stage instances in this guild.

stickers: SimpleCollection<string, RawSticker, Sticker, "id">

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.

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 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

  • Create a test entitlement for this guild.

    Parameters

    • skuID: string

      The ID of the SKU to create an entitlement for.

    • Optional applicationID: string

      The ID of the application to create the entitlement for. If present, defaults to the logged in client's application id.

    Returns Promise<TestEntitlement>

  • 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>

  • 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 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 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>

  • 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