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

Function cb_handler

plugins/commands.py:317–407  ·  view source on GitHub ↗
(client: Client, query: CallbackQuery)

Source from the content-addressed store, hash-verified

315
316@Client.on_callback_query()
317async def cb_handler(client: Client, query: CallbackQuery):
318 if query.data == "close_data":
319 await query.message.delete()
320 elif query.data == "about":
321 buttons = [[
322 InlineKeyboardButton('Hᴏᴍᴇ', callback_data='start'),
323 InlineKeyboardButton('🔒 Cʟᴏsᴇ', callback_data='close_data')
324 ]]
325 await client.edit_message_media(
326 query.message.chat.id,
327 query.message.id,
328 InputMediaPhoto(random.choice(PICS))
329 )
330 reply_markup = InlineKeyboardMarkup(buttons)
331 me2 = (await client.get_me()).mention
332 await query.message.edit_text(
333 text=script.ABOUT_TXT.format(me2),
334 reply_markup=reply_markup,
335 parse_mode=enums.ParseMode.HTML
336 )
337
338# Don't Remove Credit Tg - @VJ_Bots
339# Subscribe YouTube Channel For Amazing Bot https://youtube.com/@Tech_VJ
340# Ask Doubt on telegram @KingVJ01
341
342 elif query.data == "start":
343 buttons = [[
344 InlineKeyboardButton('💝 sᴜʙsᴄʀɪʙᴇ ᴍʏ ʏᴏᴜᴛᴜʙᴇ ᴄʜᴀɴɴᴇʟ', url='https://youtube.com/@Tech_VJ')
345 ],[
346 InlineKeyboardButton('🔍 sᴜᴘᴘᴏʀᴛ ɢʀᴏᴜᴘ', url='https://t.me/vj_bot_disscussion'),
347 InlineKeyboardButton('🤖 ᴜᴘᴅᴀᴛᴇ ᴄʜᴀɴɴᴇʟ', url='https://t.me/vj_bots')
348 ],[
349 InlineKeyboardButton('💁‍♀️ ʜᴇʟᴘ', callback_data='help'),
350 InlineKeyboardButton('😊 ᴀʙᴏᴜᴛ', callback_data='about')
351 ]]
352 if CLONE_MODE == True:
353 buttons.append([InlineKeyboardButton('🤖 ᴄʀᴇᴀᴛᴇ ʏᴏᴜʀ ᴏᴡɴ ᴄʟᴏɴᴇ ʙᴏᴛ', callback_data='clone')])
354 reply_markup = InlineKeyboardMarkup(buttons)
355 await client.edit_message_media(
356 query.message.chat.id,
357 query.message.id,
358 InputMediaPhoto(random.choice(PICS))
359 )
360 me2 = (await client.get_me()).mention
361 await query.message.edit_text(
362 text=script.START_TXT.format(query.from_user.mention, me2),
363 reply_markup=reply_markup,
364 parse_mode=enums.ParseMode.HTML
365 )
366
367# Don't Remove Credit Tg - @VJ_Bots
368# Subscribe YouTube Channel For Amazing Bot https://youtube.com/@Tech_VJ
369# Ask Doubt on telegram @KingVJ01
370
371 elif query.data == "clone":
372 buttons = [[
373 InlineKeyboardButton('Hᴏᴍᴇ', callback_data='start'),
374 InlineKeyboardButton('🔒 Cʟᴏsᴇ', callback_data='close_data')

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected