Represents a Discord server.

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

Properties

afkChannel: null | VoiceChannel | Uncached

This guild's afk voice channel. This can be a partial object with just an id property.

afkTimeout: number

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

application: null | ClientApplication | Uncached

The application that created this guild, if applicable. This can be a partial object with just an id property.

approximateMemberCount?: number

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

approximatePresenceCount?: number

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

autoModerationRules: Collection<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: ("AUTO_MODERATION" | "ANIMATED_BANNER" | "ANIMATED_ICON" | "BANNER" | "COMMERCE" | "COMMUNITY" | "CREATOR_MONETIZABLE" | "CREATOR_MONETIZABLE_DISABLED" | "DISCOVERABLE" | "DISCOVERABLE_DISABLED" | "ENABLED_DISCOVERABLE_BEFORE" | "FEATURABLE" | "GUILD_HOME_TEST" | "HAS_DIRECTORY_ENTRY" | "HUB" | "INVITE_SPLASH" | "LINKED_TO_HUB" | "MEMBER_VERIFICATION_GATE_ENABLED" | "MONETIZATION_ENABLED" | "MORE_EMOJI" | "MORE_EMOJIS" | "MORE_STICKERS" | "NEWS" | "NEW_THREAD_PERMISSIONS" | "PARTNERED" | "PREVIEW_ENABLED" | "PREVIOUSLY_DISCOVERABLE" | "PRIVATE_THREADS" | "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: Collection<string, RawIntegration, Integration, []>

The integrations in this guild.

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

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: Collection<string, RawMember, 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.

oauthOwner?: boolean

If the current user is the owner of this guild (only present when getting the current user's guilds).

owner: User | Uncached

The id of the owner of this guild.

permissions?: Permission

The permissions of the current user in this guild (only present when getting the current user's guilds).

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

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

region?: null | string

Deprecated

The region of this guild.

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

The roles in this guild.

rulesChannel: null | TextChannel | Uncached

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

scheduledEvents: Collection<string, RawScheduledEvent, GuildScheduledEvent, []>

The scheduled events in this guild.

splash: null | string

The invite splash hash of this guild.

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

The stage instances in this guild.

stickers: Sticker[]

The custom stickers of this guild.

systemChannel: null | TextChannel | Uncached

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

systemChannelFlags: number

The flags for the system channel.

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 verfication level of this guild.

voiceStates: Collection<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 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

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

    Parameters

    • code: string

      The code of the template.

    Returns Promise<void>

  • Edit an existing auto moderation rule in this guild.

    Parameters

    • ruleID: string

      The ID of the rule to edit.

    • options: Partial<Pick<CreateAutoModerationRuleOptions, "name" | "reason" | "actions" | "enabled" | "eventType" | "triggerMetadata" | "exemptRoles" | "exemptChannels">>

      The options for editing the rule.

    Returns Promise<undefined | AutoModerationRule>

  • Edit an existing emoji in this guild.

    Parameters

    Returns Promise<{ animated: boolean; available: boolean; id: string; managed: boolean; name: string; require_colons: boolean; roles: string[]; user: undefined | User }>

  • Get a ban in this guild.

    Parameters

    • userID: string

      The ID of the user to get the ban of.

    Returns Promise<Ban>

  • Get the roles in this guild. Only use this if you need to. See the roles collection.

    Returns Promise<Role[]>

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

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