Resolve type assertions

This commit is contained in:
2025-05-23 20:21:58 +02:00
parent 3088a75a7d
commit 5b8cbf8b9f
6 changed files with 32 additions and 6 deletions

View File

@@ -12,6 +12,9 @@ async def post_init(application: Application, bot_config: BotConfig) -> None:
await application.bot.set_my_commands(bot_config.commands)
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE, users: Users):
assert update.effective_user is not None
assert update.message is not None
user_id = str(update.effective_user.id)
role = users.get_role(user_id)
keyboard = []
@@ -39,6 +42,7 @@ async def start(update: Update, context: ContextTypes.DEFAULT_TYPE, users: Users
async def handle_main_menu_callback(update: Update, context: ContextTypes.DEFAULT_TYPE, users: Users, gates: Gates):
query = update.callback_query
assert query is not None
data = query.data
if data == "open_gate_menu":
await open_gate_menu(update, context, gates=gates)