post management returned

This commit is contained in:
2025-08-26 06:01:18 +09:00
parent c16ec54891
commit 8b554f5968
6 changed files with 598 additions and 180 deletions

View 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")