
Last chance! 50% off unlimited learning
Sale ends in
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)
An S3 object of class "TelegramNotifier"
.
A character string representing your Telegram bot token, typically
something like "123456:ABC-xxxx"
.
A character string or numeric representing the chat/group to send messages to.
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()
.
if (FALSE) { # interactive()
# Create a Telegram notifier (requires setting up a Telegram Bot)
telegram_notifier <- new_TelegramNotifier(bot_token = "123456:ABC-xyz", chat_id = "987654321")
}
Run the code above in your browser using DataLab