Skip to main content
Module

x/grammy_hydrate/data/message.ts>MessageXFragment

Hydration plugin for API calls and context objects.
Latest
interface MessageXFragment
import { type MessageXFragment } from "https://deno.land/x/grammy_hydrate@v1.4.1/data/message.ts";

Methods

forward(
chat_id: number | string,
other?: Other<"forwardMessage", "from_chat_id">,
signal?: AbortSignal,
): Ret<"forwardMessage">

Message-aware alias for api.forwardMessage. Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.

copy(
chat_id: number | string,
other?: Other<"copyMessage", "from_chat_id">,
signal?: AbortSignal,
): Ret<"copyMessage">

Message-aware alias for api.copyMessage. Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.

delete(signal?: AbortSignal): Ret<"deleteMessage">

Message-aware alias for api.deleteMessage. Use this method to delete a message, including service messages, with the following limitations:

  • A message can only be deleted if it was sent less than 48 hours ago.
  • A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
  • Bots can delete outgoing messages in private chats, groups, and supergroups.
  • Bots can delete incoming messages in private chats.
  • Bots granted can_post_messages permissions can delete outgoing messages in channels.
  • If the bot is an administrator of a group, it can delete any message there.
  • If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there. Returns True on success.
react(
reaction: ReactionTypeEmoji["emoji"] | ReactionType | Array<ReactionTypeEmoji["emoji"] | ReactionType>,
other?: Other<"setMessageReaction", "reaction">,
signal?: AbortSignal,
): Ret<"setMessageReaction">

Message-aware alias for api.setMessageReaction. Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success.

getCustomEmojiStickers(signal?: AbortSignal): Ret<"getCustomEmojiStickers">

Message-aware alias for api.getCustomEmojiStickers. Use this method to get information about emoji stickers by their identifiers. Returns an Array of Sticker on success.