diff --git a/telegram_bot/bot.py b/telegram_bot/bot.py index c62083f..5fc363f 100644 --- a/telegram_bot/bot.py +++ b/telegram_bot/bot.py @@ -154,6 +154,21 @@ def send_id(message): bot.reply_to(message, answer) +#function that sends telegram status(running or offline) as message from telegram bot to user +@bot.message_handler(commands=['status']) +def send_status(message): + + """ Sends status to user + :type message: message object bot + :param message: message that was reacted to, if no other command handler gets called + + :raises: none + + :rtype: none + """ + bot.reply_to(message, "bot is running") + + @bot.message_handler(commands=['update']) def send_update(message): @@ -306,9 +321,6 @@ def main_loop(): :rtype: none """ bot.infinity_polling() - while 1: - time.sleep(3) - if __name__ == '__main__': try: