Class Guild

Represents a Discord server.

Hierarchy

Accessors

Constructors

Methods

Properties

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

Constructors

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>

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

  • 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

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: ("ANIMATED_BANNER" | "ANIMATED_ICON" | "APPLICATION_COMMAND_PERMISSIONS_V2" | "AUTO_MODERATION" | "BANNER" | "BOT_DEVELOPER_EARLY_ACCESS" | "CLYDE_ENABLED" | "COMMUNITY_EXP_LARGE_GATED" | "COMMUNITY_EXP_LARGE_UNGATED" | "COMMUNITY_EXP_MEDIUM" | "COMMUNITY" | "CREATOR_MONETIZABLE_DISABLED" | "CREATOR_MONETIZABLE_PROVISIONAL" | "CREATOR_MONETIZABLE" | "CREATOR_STORE_PAGE" | "DEVELOPER_SUPPORT_SERVER" | "DISCOVERABLE_DISABLED" | "DISCOVERABLE" | "ENABLED_DISCOVERABLE_BEFORE" | "EXPOSED_TO_ACTIVITIES_WTP_EXPERIMENT" | "FEATURABLE" | "GUESTS_ENABLED" | "GUILD_HOME_TEST" | "GUILD_ONBOARDING_EVER_ENABLED" | "GUILD_ONBOARDING_HAS_PROMPTS" | "GUILD_ONBOARDING" | "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_VERIFICATION_GATE_ENABLED" | "MONETIZATION_ENABLED" | "MORE_EMOJI" | "MORE_EMOJIS" | "MORE_STICKERS" | "NEW_THREAD_PERMISSIONS" | "NEWS" | "PARTNERED" | "PREVIEW_ENABLED" | "PREVIOUSLY_DISCOVERABLE" | "PRIVATE_THREADS" | "RAID_ALERTS_ENABLED" | "ROLE_ICONS" | "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE" | "ROLE_SUBSCRIPTIONS_ENABLED" | "SEVEN_DAY_THREAD_ARCHIVE" | "SOUNDBOARD" | "TEXT_IN_VOICE_ENABLED" | "THREADS_ENABLED_TESTING" | "THREADS_ENABLED" | "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<RawIntegration, Integration, [guildID?: string]>

The integrations in this guild.

invites: SimpleCollection<string, RawInvite, Invite<"withMetadata", Uncached | AnyInviteChannel>, "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.