diff options
| author | Andrew <saintruler@gmail.com> | 2020-02-11 18:52:54 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2020-02-11 18:52:54 +0400 |
| commit | a2d7e6357ea7d9ffcd361580b5d48eefeb1e69cb (patch) | |
| tree | d2a56d22b1b1add044a8c4bfd6510f0f675467fd /utils.py | |
| parent | 1ca68c0b1af0f7fb5812c831d61cd85d282f08e1 (diff) | |
Implemented basic state handling and bot views.
Diffstat (limited to 'utils.py')
| -rw-r--r-- | utils.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..a25571e --- /dev/null +++ b/utils.py @@ -0,0 +1,14 @@ +def get_input(update, user_data): + if "resuming" in user_data and user_data["resuming"] == True: + return user_data["text"] + else: + return update.message.text + + +( + WAIT_FOR_USERNAME, + MAIN_MENU, TOP_10, RULES, + TASK_CHOOSING, TASK_SHOWN, ANSWERING, + ANSWER_RIGHT, ANSWER_WRONG, + *_ +) = range(100)
\ No newline at end of file |