Nostrum.Api.edit_message

You're seeing just the function edit_message, go back to Nostrum.Api module for more information.
Link to this function

edit_message(message, options)

View Source

Specs

edit_message(Nostrum.Struct.Message.t(), options()) ::
  error() | {:ok, Nostrum.Struct.Message.t()}

Same as edit_message/3, but takes a Nostrum.Struct.Message instead of a channel_id and message_id.

Link to this function

edit_message(channel_id, message_id, options)

View Source

Specs

Edits a previously sent message in a channel.

This endpoint requires the VIEW_CHANNEL permission. It fires the Nostrum.Consumer.message_update/0 event.

If options is a string, options will be used as the message's content.

If successful, returns {:ok, message}. Otherwise, returns a Nostrum.Api.error/0.

Options

  • :content (string) - the message contents (up to 2000 characters)
  • :embed (Nostrum.Struct.Embed.t/0) - embedded rich content

Examples

Nostrum.Api.edit_message(43189401384091, 1894013840914098, content: "hello world!")

Nostrum.Api.edit_message(43189401384091, 1894013840914098, "hello world!")

import Nostrum.Struct.Embed
embed =
  %Nostrum.Struct.Embed{}
  |> put_title("embed")
  |> put_description("new desc")
Nostrum.Api.edit_message(43189401384091, 1894013840914098, embed: embed)

Nostrum.Api.edit_message(43189401384091, 1894013840914098, content: "hello world!", embed: embed)