A wrapper for the Telegram sendMessage function to send a plain text message (blocking execution).

This function invokes an asynchronous request to the Telegram API. To ensure successful sending of the message this function waits for the callback. If you need to return back to the caller function quickly use TelegramSendTextAsync instead.


string apiKey

The Telegram bot API key

string chatId

The Telegram chat ID that will receive the message

string chatText

The text that will be send


A string indicating if the request was successfully invoked. 0 means there was no failure.

Code Example

Print(TelegramSendText(apikey, chatid, "test")); // Will print "0" on success