aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclarkzjw <[email protected]>2023-02-23 00:30:52 -0800
committerclarkzjw <[email protected]>2023-02-23 12:07:32 -0800
commitadb574ab528fbc4401fb7cd50b8748d1fb529450 (patch)
tree9cdcad48cc8963d1b2fccb8b4e32cd5a0b6877bc /command.py
parent770cd0ec5eb556d912bd9d200b2da76c7e3bd7c8 (diff)
downloadswarm2fediverse-adb574ab528fbc4401fb7cd50b8748d1fb529450.tar.gz
bot: multi user working
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)