post management returned
This commit is contained in:
11
app/bot/handlers/cancel.py
Normal file
11
app/bot/handlers/cancel.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from telegram import Update
|
||||
from telegram.ext import ContextTypes
|
||||
|
||||
# те же ключи, что используются в редакторе/импорте/привязке
|
||||
DRAFT_KEYS = ("draft_state", "draft_id")
|
||||
OTHER_KEYS = ("await_dict_file", "dict_params", "await_chat_id")
|
||||
|
||||
async def cancel_cmd(update: Update, ctx: ContextTypes.DEFAULT_TYPE):
|
||||
for k in DRAFT_KEYS + OTHER_KEYS:
|
||||
ctx.user_data.pop(k, None)
|
||||
await update.effective_message.reply_text("Состояние сброшено. Можно начать заново: /new")
|
||||
Reference in New Issue
Block a user