aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'command.py')
-rw-r--r--command.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/command.py b/command.py
index 901b792..7426901 100644
--- a/command.py
+++ b/command.py
@@ -2,15 +2,21 @@ from telegram import Update
2from telegram.constants import ParseMode 2from telegram.constants import ParseMode
3from telegram.error import BadRequest 3from telegram.error import BadRequest
4from telegram.ext import ContextTypes, ConversationHandler 4from telegram.ext import ContextTypes, ConversationHandler
5 5from dbstore.peewee_store import get_user_access_key
6from config import * 6from config import *
7 7
8 8
9async def start_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int: 9async def start_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int:
10 await update.message.reply_text(PROMPT_START, parse_mode=ParseMode.MARKDOWN) 10 await update.message.reply_text(PROMPT_START, parse_mode=ParseMode.MARKDOWN)
11 await update.message.reply_text(PROMPT_CHOOSE_ACTION, reply_markup=MAIN_MENU) 11 user_access_key = get_user_access_key(str(update.effective_user.id))
12 12 # TODO
13 return WAIT_LOCATION 13 # verify user access key still valid
14 if len(user_access_key) == 0:
15 await update.message.reply_text(PROMPT_FEDI_LOGIN_WHERE_IS_INSTANCE, parse_mode=ParseMode.MARKDOWN)
16 return FEDI_LOGIN
17 else:
18 await update.message.reply_text(PROMPT_CHOOSE_ACTION, reply_markup=MAIN_MENU)
19 return WAIT_LOCATION
14 20
15 21
16async def fedi_login_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int: 22async def fedi_login_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int:
Powered by cgit v1.2.3 (git 2.41.0)