Options
All
  • Public
  • Public/Protected
  • All
Menu

Message resource

Hierarchy

  • MessagesResource

Index

Constructors

constructor

Methods

bulkDelete

  • bulkDelete(channelId: string, messageIds: string[]): Promise<never>
  • Deletes multiple messages

    Parameters

    • channelId: string

      ID of channel

    • messageIds: string[]

      ID of messages

    Returns Promise<never>

crosspost

  • crosspost(channelId: string, messageId: string): Promise<APIMessage>
  • Publishes a message in a news channel

    Parameters

    • channelId: string

      ID of channel

    • messageId: string

      ID of message

    Returns Promise<APIMessage>

delete

  • delete(channelId: string, messageId: string): Promise<never>

deleteAllReactions

  • deleteAllReactions(channelId: string, messageId: string, emoji?: string): Promise<never>
  • Deletes multiple reactions from a message

    Parameters

    • channelId: string

      ID of channel

    • messageId: string

      ID of message

    • Optional emoji: string

      Emoji ID or unicode, or leave blank to remove all reactions

    Returns Promise<never>

deleteReaction

  • deleteReaction(channelId: string, messageId: string, emoji: string, user?: string): Promise<never>
  • Removes one reaction for a specific user

    Parameters

    • channelId: string

      ID of channel

    • messageId: string

      ID of message

    • emoji: string

      ID or unicode for emoji

    • user: string = '@me'

      Users or leave blank to remove your own

    Returns Promise<never>

edit

  • edit(channelId: string, messageId: string, data: MessageTypes): Promise<APIMessage>

get

  • get(channelId: string, messageId: string): Promise<APIMessage>

getReactions

  • getReactions(channelId: string, messageId: string, emoji: string, query?: RESTGetAPIChannelMessageReactionUsersQuery): Promise<RESTGetAPIChannelMessageReactionUsersResult>
  • Gets users who've reacted with a specific emoji

    Parameters

    • channelId: string

      ID of channel

    • messageId: string

      ID of message

    • emoji: string

      ID or unicode for emoji

    • Optional query: RESTGetAPIChannelMessageReactionUsersQuery

      Query for fetching

    Returns Promise<RESTGetAPIChannelMessageReactionUsersResult>

react

  • react(channelId: string, messageId: string, emoji: string): Promise<never>
  • Adds a reaction to a message

    Parameters

    • channelId: string

      ID of channel

    • messageId: string

      ID of message

    • emoji: string

      ID or unicode for emoji

    Returns Promise<never>

send

  • send(channelId: string, data: MessageTypes, reply?: APIMessageReferenceSend): Promise<APIMessage>

sendFile

  • sendFile(channelId: string, data: { buffer: Buffer; name: string }, extra?: MessageTypes): Promise<APIMessage>
  • Sends a file to a channel

    Parameters

    • channelId: string

      ID of channel

    • data: { buffer: Buffer; name: string }

      File Buffer and name

      • buffer: Buffer
      • name: string
    • Optional extra: MessageTypes

      Extra message data

    Returns Promise<APIMessage>

Static _formMessage

  • _formMessage(message: MessageTypes, webhook?: boolean): RESTPostAPIChannelMessageJSONBody | RESTPostAPIWebhookWithTokenJSONBody | APIInteractionResponseCallbackData

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Static method

Generated using TypeDoc