Skip to content

sendMessage

Sahri Riza Umami edited this page Dec 8, 2016 · 3 revisions

Sends a message.

sendMessage(chat_id, reply_to_message_id, disable_notification, text, disable_web_page_preview, parse_mode)

Returns sent message.
UpdateChatTopMessage will not be sent, so returned message should be used to update chat top message.

Option Description
chat_id Chat to send message.
reply_to_message_id Identifier of a message to reply to or 0.
disable_notification Pass true, to disable notification about the message.
from_background Pass true, if the message is sent from background.
reply_markup Bots only. Markup for replying to message.
input_message_content Content of a message to send.

Example

  • Send HTML formatted text message.
sendMessage(1234567890, 0, 0, '<b>bold</b>\n<i>italic</i>\n<code>monospace</code>', 1, 'html')
  • Send Markdown formatted text message.
sendMessage(1234567890, 0, 0, '*bold*\n_italic_\n`monospace`', 1, 'md')
  • Reply message.
sendMessage(1234567890, 17, 0, 'Replied this message', 1, 'md')

Test script
Frequently Asked Questions
The Functions

Clone this wiki locally