summaryrefslogtreecommitdiff
path: root/keyboards.py
diff options
context:
space:
mode:
authorAndrew <saintruler@gmail.com>2020-02-11 21:42:01 +0400
committerAndrew <saintruler@gmail.com>2020-02-11 21:42:01 +0400
commitbc2124fbfa33b0aa5969c86523afb4f404e21ee5 (patch)
tree82b7c96ec304fa912b21f72e244e788ae74a6037 /keyboards.py
parenta2d7e6357ea7d9ffcd361580b5d48eefeb1e69cb (diff)
Added new bindings for backend api. Implemented restoring state of bot
for user after restarting bot.
Diffstat (limited to 'keyboards.py')
-rw-r--r--keyboards.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/keyboards.py b/keyboards.py
index 5966d90..cbdd770 100644
--- a/keyboards.py
+++ b/keyboards.py
@@ -35,9 +35,11 @@ class TasksKeyboard(Keyboard):
@classmethod
def get_keyboard(cls, telegram_id=None):
- tasks = backend_api.get_tasks()
+ status, tasks = backend_api.get_tasks()
titles_keyboard = [[cls.CANCEL]]
- titles_keyboard.extend([task.get("title")] for task in tasks)
+ if status == 200:
+ titles_keyboard.extend([task.get("title")] for task in tasks)
+
return titles_keyboard