deleteMessage method

Future<bool> deleteMessage()

Deletes the current message.

This method can only be called when the update contains a message.

Example:

await ctx.deleteMessage(); // Deletes the current message

Implementation

Future<bool> deleteMessage() async {
  final chatId = _getChatId();
  final msgId = messageId;
  _verifyInfo(
    [chatId, msgId],
    APIMethod.deleteMessage,
    description:
        "No message or chat information found in the current update.",
  );

  return api.deleteMessage(chatId!, msgId!);
}