View source: R/notifications.R
new_TelegramNotifier | R Documentation |
Constructs a notifier object for sending messages via Telegram. Requires a valid Telegram bot token and chat ID.
new_TelegramNotifier(bot_token, chat_id, verbose_issues = FALSE)
bot_token |
A character string representing your Telegram bot token, typically
something like |
chat_id |
A character string or numeric representing the chat/group to send messages to. |
verbose_issues |
Logical. If TRUE, provides detailed information about warnings and errors in the notifications. |
To use send notifications over Telegram with httr
in SimDesign
,
install httr
, set set up a Telegram bot, and obtain a bot token and chat ID.
For more information, see the Telegram Bots API.
Then use the new_TelegramNotifier()
function to create a TelegramNotifier
object and pass it to the notifier
argument in runSimulation()
.
An S3 object of class "TelegramNotifier"
.
# Create a Telegram notifier (requires setting up a Telegram Bot)
telegram_notifier <- new_TelegramNotifier(bot_token = "123456:ABC-xyz", chat_id = "987654321")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.