Context handling implemented
This commit is contained in:
@@ -12,18 +12,22 @@ from modules.database import col_entries
|
||||
|
||||
|
||||
@PyroClient.on_message(
|
||||
~filters.scheduled & filters.private & custom_filters.owner & filters.command(["import"], prefixes=["/"]) # type: ignore
|
||||
~filters.scheduled & filters.private & custom_filters.owner & filters.command(["import"], prefixes=["/"]) & ~custom_filters.context # type: ignore
|
||||
)
|
||||
async def command_import(app: PyroClient, message: Message):
|
||||
user = await app.find_user(message.from_user)
|
||||
|
||||
await message.reply_text(
|
||||
app._("import", "messages", locale=user.locale),
|
||||
reply_markup=ForceReply(placeholder=""),
|
||||
reply_markup=ForceReply(
|
||||
placeholder=app._("import", "force_replies", locale=user.locale)
|
||||
),
|
||||
)
|
||||
|
||||
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(
|
||||
|
Reference in New Issue
Block a user