From 068fb8a1b5a51857b42ee1bc4673ab0fa34fb3ab Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Fri, 27 Nov 2020 11:56:10 -0500 Subject: [PATCH] [+] Add enabled tasks information to /ls --- src/commands.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/commands.py b/src/commands.py index a5b7f2a..f3d4ca6 100644 --- a/src/commands.py +++ b/src/commands.py @@ -1,4 +1,5 @@ import re +from datetime import datetime from io import BytesIO from telegram import Bot, Update @@ -71,6 +72,13 @@ def ls(update: Update, context: CallbackContext): msg += name + ' ' * (18 - len(name)) + requests[name]['url'] + '\n' msg += '```' + if user in scheduler.storage: + msg += '\n*Enabled requests:* \n```\n' + for name in scheduler.storage[user]: + cache: CacheEntry = scheduler.storage[user][name] + msg += cache.name + ' ' * (18 - len(name)) + datetime.fromtimestamp(cache.time).strftime('%b %d %Y %H:%M:%S') + '\n' + msg += '```' + return msg