Update Telegram.py

Set message parse mode to HTML to allow a number of formatting options like bold and italic.
See https://core.telegram.org/bots/api#formatting-options for full details.
This commit is contained in:
PeterLaemmle 2020-09-28 20:54:34 +02:00 committed by GitHub
parent 0f95820bff
commit 4958ae4c1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,7 +94,7 @@ def run(typ,freq,data):
bot = telegram.Bot(token='%s' % BOTTokenAPIKey)
# Send message to chat via Telegram BOT API
logging.debug("Send message to chat via Telegram BOT API")
bot.sendMessage('%s' % BOTChatIDAPIKey, text)
bot.sendMessage('%s' % BOTChatIDAPIKey, text, parse_mode=telegram.ParseMode.HTML)
# Generate location information only for specific RIC
if typ == "POC" and data["ric"] == RICforLocationAPIKey: