(client: Client, query: CallbackQuery)
| 54 | |
| 55 | @Client.on_callback_query() |
| 56 | async def cb_handler(client: Client, query: CallbackQuery): |
| 57 | if query.data=="help": |
| 58 | buttons = [ |
| 59 | [ |
| 60 | InlineKeyboardButton("🔙 BACK", callback_data="start"), |
| 61 | InlineKeyboardButton ("SUPPORT 💬", url=f"https://t.me/{SUPPORT_GROUP}"), |
| 62 | ] |
| 63 | ] |
| 64 | reply_markup = InlineKeyboardMarkup(buttons) |
| 65 | try: |
| 66 | await query.edit_message_text( |
| 67 | HELP_TEXT, |
| 68 | reply_markup=reply_markup |
| 69 | ) |
| 70 | except MessageNotModified: |
| 71 | pass |
| 72 | |
| 73 | elif query.data=="about": |
| 74 | buttons = [ |
| 75 | [ |
| 76 | InlineKeyboardButton("🔙 BACK", callback_data="start"), |
| 77 | InlineKeyboardButton ("SUPPORT 💬", url=f"https://t.me/{SUPPORT_GROUP}"), |
| 78 | ] |
| 79 | ] |
| 80 | reply_markup = InlineKeyboardMarkup(buttons) |
| 81 | try: |
| 82 | await query.edit_message_text( |
| 83 | ABOUT_TEXT, |
| 84 | reply_markup=reply_markup |
| 85 | ) |
| 86 | except MessageNotModified: |
| 87 | pass |
| 88 | |
| 89 | elif query.data=="start": |
| 90 | buttons = [ |
| 91 | [ |
| 92 | InlineKeyboardButton("❔ HOW TO USE ME ❔", callback_data="help"), |
| 93 | ], |
| 94 | [ |
| 95 | InlineKeyboardButton("📢 CHANNEL", url=f"https://t.me/{UPDATES_CHANNEL}"), |
| 96 | InlineKeyboardButton("SOURCE 📦", url=f"https://github.com/AsmSafone/VideoPlayerBot"), |
| 97 | ], |
| 98 | [ |
| 99 | InlineKeyboardButton("🤖 ABOUT", callback_data="about"), |
| 100 | InlineKeyboardButton("CLOSE 🔒", callback_data="close"), |
| 101 | ], |
| 102 | [ |
| 103 | InlineKeyboardButton("➕ ADD ME TO YOUR GROUP ➕", url=f"https://t.me/{USERNAME}?startgroup=true"), |
| 104 | ] |
| 105 | ] |
| 106 | reply_markup = InlineKeyboardMarkup(buttons) |
| 107 | try: |
| 108 | await query.edit_message_text( |
| 109 | START_TEXT, |
| 110 | reply_markup=reply_markup |
| 111 | ) |
| 112 | except MessageNotModified: |
| 113 | pass |
nothing calls this directly
no outgoing calls
no test coverage detected