MCPcopy Create free account
hub / github.com/VJBots/VJ-File-Store / cb_handler

Function cb_handler

clone_plugins/commands.py:152–216  ·  view source on GitHub ↗
(client: Client, query: CallbackQuery)

Source from the content-addressed store, hash-verified

150
151@Client.on_callback_query()
152async def cb_handler(client: Client, query: CallbackQuery):
153 me = await client.get_me()
154 if query.data == "close_data":
155 await query.message.delete()
156 elif query.data == "start":
157 buttons = [[
158 InlineKeyboardButton('💝 sᴜʙsᴄʀɪʙᴇ ᴍʏ ʏᴏᴜᴛᴜʙᴇ ᴄʜᴀɴɴᴇʟ', url='https://youtube.com/@Tech_VJ')
159 ],[
160 InlineKeyboardButton('🤖 ᴄʀᴇᴀᴛᴇ ʏᴏᴜʀ ᴏᴡɴ ᴄʟᴏɴᴇ ʙᴏᴛ', url=f'https://t.me/{BOT_USERNAME}?start=clone')
161 ],[
162 InlineKeyboardButton('💁‍♀️ ʜᴇʟᴘ', callback_data='help'),
163 InlineKeyboardButton('ᴀʙᴏᴜᴛ 🔻', callback_data='about')
164 ]]
165
166 reply_markup = InlineKeyboardMarkup(buttons)
167 await client.edit_message_media(
168 query.message.chat.id,
169 query.message.id,
170 InputMediaPhoto(random.choice(PICS))
171 )
172 await query.message.edit_text(
173 text=script.CLONE_START_TXT.format(query.from_user.mention, me.mention),
174 reply_markup=reply_markup,
175 parse_mode=enums.ParseMode.HTML
176 )
177
178# Don't Remove Credit Tg - @VJ_Bots
179# Subscribe YouTube Channel For Amazing Bot https://youtube.com/@Tech_VJ
180# Ask Doubt on telegram @KingVJ01
181
182 elif query.data == "help":
183 buttons = [[
184 InlineKeyboardButton('Hᴏᴍᴇ', callback_data='start'),
185 InlineKeyboardButton('🔒 Cʟᴏsᴇ', callback_data='close_data')
186 ]]
187 await client.edit_message_media(
188 query.message.chat.id,
189 query.message.id,
190 InputMediaPhoto(random.choice(PICS))
191 )
192 reply_markup = InlineKeyboardMarkup(buttons)
193 await query.message.edit_text(
194 text=script.CHELP_TXT,
195 reply_markup=reply_markup,
196 parse_mode=enums.ParseMode.HTML
197 )
198
199 elif query.data == "about":
200 buttons = [[
201 InlineKeyboardButton('Hᴏᴍᴇ', callback_data='start'),
202 InlineKeyboardButton('🔒 Cʟᴏsᴇ', callback_data='close_data')
203 ]]
204 await client.edit_message_media(
205 query.message.chat.id,
206 query.message.id,
207 InputMediaPhoto(random.choice(PICS))
208 )
209 owner = mongo_db.bots.find_one({'bot_id': me.id})

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected