From 428f42abea9d4ce4854eea4cb68172cfa1e14ecf Mon Sep 17 00:00:00 2001 From: git-sid <25916907+git-sid@users.noreply.github.com> Date: Thu, 14 Feb 2019 09:49:18 +0100 Subject: [PATCH] Add ping functionality to telegram bot. TODO: add lag time to response --- active_bots/telegrambot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/active_bots/telegrambot.py b/active_bots/telegrambot.py index 9fdbd66..4b7498f 100644 --- a/active_bots/telegrambot.py +++ b/active_bots/telegrambot.py @@ -50,6 +50,9 @@ class TelegramBot(Bot): "Send reports here to share them with other users. " "Use /start and /stop to get reports or not.") # TODO: /help message should be set in frontend + elif update.message.text.lower() == "/ping": + tb.send_message( + update.message.sender.id, "pong") else: # set report.author to "" to avoid mailbot crash sender_name = update.message.sender.username