feat: add inline delete button to /bounty list

- Add inline keyboard with delete button on bounty list messages
- Only the user who triggered the command can delete the message
- Message is actually removed from the chat
- Uses callback query handler for button clicks
This commit is contained in:
shokollm
2026-04-04 23:25:20 +00:00
parent d01d147a45
commit dfafefe071
2 changed files with 58 additions and 2 deletions

View File

@@ -6,13 +6,20 @@ import sys
sys.path.insert(0, "/home/shoko/repositories/jigaido")
from telegram.ext import Application, CommandHandler, MessageHandler, filters
from telegram.ext import (
Application,
CommandHandler,
MessageHandler,
CallbackQueryHandler,
filters,
)
from commands import (
cmd_add,
cmd_admin,
cmd_bounty,
cmd_delete,
cmd_delete_message,
cmd_edit,
cmd_help,
cmd_my,
@@ -54,6 +61,8 @@ def build_app() -> Application:
app.add_handler(CommandHandler("admin", cmd_admin))
app.add_handler(CommandHandler("recover", cmd_recover))
app.add_handler(CallbackQueryHandler(cmd_delete_message))
app.add_handler(MessageHandler(filters.COMMAND, cmd_help))
return app