Various methods for interacting with guilds.

Hierarchy

  • Guilds

Constructors

Methods

  • Add a member to a 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

    • guildID: string

      The ID of the guild.

    • 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

    • guildID: string

      The ID of the guild.

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

  • Create a bon for a user.

    Parameters

    • guildID: string

      The ID of the guild.

    • userID: string

      The ID of the user to ban.

    • Optional options: CreateBanOptions

      The options for creating the bon.

    Returns Promise<void>

  • Delete a guild.

    Parameters

    • guildID: string

      The ID of the guild.

    Returns Promise<void>

  • Delete an auto moderation rule.

    Parameters

    • guildID: string

      The ID of the guild.

    • ruleID: string

      The ID of the rule to delete.

    • Optional reason: string

      The reason for deleting the rule.

    Returns Promise<void>

  • Delete an emoji.

    Parameters

    • guildID: string

      The ID of the guild.

    • emojiID: string

      The ID of the emoji.

    • Optional reason: string

      The reason for deleting the emoji.

    Returns Promise<void>

  • Delete an integration.

    Parameters

    • guildID: string

      The ID of the guild.

    • integrationID: string

      The ID of the integration.

    • Optional reason: string

      The reason for deleting the integration.

    Returns Promise<void>

  • Delete a role.

    Parameters

    • guildID: string

      The ID of the guild.

    • 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

    • guildID: string

      The ID of the guild.

    • 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

    • guildID: string

      The ID of the guild.

    • 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

    • guildID: string

      The ID of the guild.

    • code: string

      The code of the template.

    Returns Promise<void>

  • Edit a guild.

    Note: If the client's cache does not already contain the guild, it will not be added.

    Parameters

    • guildID: string

      The ID of the guild.

    • options: EditGuildOptions

      The options for editing the guild.

    Returns Promise<Guild>

  • Edit an existing auto moderation rule.

    Parameters

    • guildID: string

      The ID of the guild.

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

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

    Parameters

    • guildID: string

      The ID of the guild.

    • memberID: string

      The ID of the member.

    • options: EditMemberOptions

      The options for editing the member.

    Returns Promise<Member>

  • Edit a guild member's voice state. channelID is required, and the user must already be in that channel. See Discord's docs for more information.

    Parameters

    • guildID: string

      The ID of the guild.

    • memberID: string

      The ID of the member.

    • options: EditUserVoiceStateOptions

      The options for editing the voice state.

    Returns Promise<void>

  • Get a guild.

    Note: If the guild is not already in the client's cache, this will not add it.

    Parameters

    • guildID: string

      The ID of the guild.

    • Optional withCounts: boolean

      If the approximate number of members and online members should be included.

    Returns Promise<Guild>

  • Get a ban.

    Parameters

    • guildID: string

      The ID of the guild.

    • userID: string

      The ID of the user to get the ban of.

    Returns Promise<Ban>

  • Get an emoji in a guild.

    Parameters

    • guildID: string

      The ID of the guild.

    • emojiID: string

      The ID of the emoji to get.

    Returns Promise<GuildEmoji>

  • Get a guild member.

    Parameters

    • guildID: string

      The ID of the guild.

    • memberID: string

      The ID of the member.

    Returns Promise<Member>

  • Get a preview of a guild. If the client is not already in this guild, the guild must be lurkable.

    Parameters

    • guildID: string

      The ID of the guild.

    Returns Promise<GuildPreview>

  • Get the roles in a guild.

    Parameters

    • guildID: string

      The ID of the guild.

    Returns Promise<Role[]>

  • Get a scheduled event.

    Parameters

    • guildID: string

      The ID of the guild.

    • 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 guild's scheduled events.

    Parameters

    • guildID: string

      The ID of the guild.

    • 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

    • guildID: string

      The ID of the guild.

    • stickerID: string

      The ID of the sticker to get.

    Returns Promise<Sticker>

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

    Parameters

    • guildID: string

      The ID of the guild.

    Returns Promise<Sticker[]>

  • Get the list of usable voice regions for a guild. This will return VIP servers when the guild is VIP-enabled.

    Parameters

    • guildID: string

      The ID of the guild.

    Returns Promise<VoiceRegion[]>

  • Remove a ban.

    Parameters

    • guildID: string

      The ID of the guild.

    • 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 a guild.

    Parameters

    • guildID: string

      The ID of the guild.

    • 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

    • guildID: string

      The ID of the guild.

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