Skip to content

sendMessage

Sahri Riza Umami edited this page Jun 24, 2018 · 4 revisions

Sends a message.
Returns the sent message.

sendMessage(chat_id, reply_to_message_id, input_message_content, parse_mode, disable_notification, from_background, reply_markup, callback, data)
Field Type Description
chat_id int53 Target chat.
reply_to_message_id int53 Identifier of the message to reply to.
input_message_content InputMessageContent The content of the message to be sent.
parse_mode string Text parse mode.
disable_notification Bool Pass true to disable notification for the message. Not supported in secret chats.
from_background Bool Pass true if the message is sent from the background.
reply_markup ReplyMarkup Markup for replying to the message; for bots only.

Example

  • Sends an HTML formatted text message to chat 1234567890.

    sendMessage(1234567890, 0, '{["@type"] = "inputMessageText",text = {text = "<b>BOLD</b>"}}', 'html')
  • Sends a GIF animation message to chat 1234567890, and give it a caption formatted in Markdown.

    sendMessage(1234567890, 0, '{["@type"]="inputMessageAnimation",animation={["@type"]="inputFileRemote",id="CgADBAAD9oEAAu4cZAdMVj7qI9SY5gI"},caption={text="*This is a caption*"},thumbnail={["@type"]="inputThumbnail",thumbnail={["@type"]="inputFileRemote"}}}, 'md')

Frequently Asked Questions
The Functions

Clone this wiki locally