Updating messages

deleteEphemeralMessage()

Use this method to delete an ephemeral message. Note that it is not guaranteed that the user will receive the message deletion event, especially if they are offline. Returns True on success.

parameters

parametertyperequireddescription
chat_idnumber | stringrequiredUnique identifier for the target chat or username of the target supergroup in the format @username
receiver_user_idnumberrequiredIdentifier of the user who received the message
ephemeral_message_idnumberrequiredIdentifier of the ephemeral message to delete

returns

boolean

usage in yaebal

deleteEphemeralMessage is directly typed on Api — call it straight off bot.api.

bot.ts
import type { DeleteEphemeralMessageParams } from "@yaebal/types";

await bot.api.deleteEphemeralMessage({
  chat_id: 123456789,
  receiver_user_id: 1,
  ephemeral_message_id: 1,
} satisfies DeleteEphemeralMessageParams);

context shortcut

also available as ctx.deleteEphemeralMessage() on 17 context types — see @yaebal/contexts.

context shortcut
/** Use this method to delete an ephemeral message. Note that it is not guaranteed that the user will receive the message deletion event, especially if they are offline. Returns *True* on success. */
ctx.deleteEphemeralMessage(params: Omit<DeleteEphemeralMessageParams, "chat_id">)