Context handling implemented

This commit is contained in:
2023-08-30 14:41:34 +02:00
parent c91d7f3afa
commit 57ff7b6765
16 changed files with 54 additions and 14 deletions

View File

@@ -22,7 +22,9 @@ async def search_name(app: PyroClient, message: Message) -> Union[Location, None
)
while location is None:
app.contexts.append(message.from_user.id)
answer = await listen_message(app, message.chat.id, 300)
app.contexts.remove(message.from_user.id)
if answer is None or answer.text == "/cancel":
await message.reply_text(
@@ -72,7 +74,9 @@ async def search_name(app: PyroClient, message: Message) -> Union[Location, None
)
while True:
app.contexts.append(message.from_user.id)
answer = await listen_message(app, message.chat.id, 300)
app.contexts.remove(message.from_user.id)
if answer is None or answer.text == "/cancel":
await message.reply_text(