Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebhookMessageBuilder

Hierarchy

Implements

  • {} & {}
  • {} & {}

Index

Constructors

constructor

Properties

auth

auth: boolean = false

Webhook messages don't use auth

data

data: PartialRequired<WebhookMessageData, "allowed_mentions">

The Webhook Message data to send to the api

files

files: File[]

The files to send to the api

Methods

Protected _split

  • _split(__namedParameters?: { append: string; char: string; maxLength: number; prepend: string }): string[]

addEmbed

  • addEmbed(embed: APIEmbedData): this
  • addEmbed(embed: (embed: Embed) => Embed): this

addFile

  • addFile(file: File): this

parseEveryone

  • parseEveryone(): this

parseRoles

  • parseRoles(...ids: string[]): this
  • Allows Role mentions to ping

    example

    messageBuilder.parseRoles(); // All roles will be mentionable.

    example

    messageBuilder.parseRoles('339959033937264641', '339947394726625300') // Only those two roles will be mentioned even if you mention other roles in your message.

    Parameters

    • Rest ...ids: string[]

      role ids you want to mention

    Returns this

parseUsers

  • parseUsers(...ids: string[]): this
  • Allows User mentions to ping

    example

    messageBuilder.parseUsers(); // All users will be mentionable.

    example

    messageBuilder.parseUsers('167383252271628289', '242043489611808769') // Only those two users will be mentioned even if you mention other users in your message.

    Parameters

    • Rest ...ids: string[]

      user ids you want to mention

    Returns this

setAvatar

  • setAvatar(avatar?: undefined | string): this

setContent

  • setContent(content?: string | null): this

setEmbed

  • setEmbed(): never

setNonce

  • setNonce(nonce?: number | string): this

setTTS

  • setTTS(tts: boolean): this

setUsername

  • setUsername(username?: undefined | string): this

spliceEmbed

  • spliceEmbed(index: number, deleteCount: number, embed?: APIEmbedData): this
  • spliceEmbed(index: number, deleteCount: number, embed?: undefined | ((embed: Embed) => Embed)): this

spliceFile

  • spliceFile(index: number, deleteCount: number, file?: File): this

split

Generated using TypeDoc