forked from kalanakt/All-Url-Uploader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallbacks.Txt
61 lines (52 loc) · 2.1 KB
/
callbacks.Txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import os
import ast
import re
import asyncio
from pyrogram import Client as kinu
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
from translation import Translation
@kinu.on_callback_query()
async def cb_handler(client: kinu, query: CallbackQuery):
if query.data == "help_kt":
buttons = [[
InlineKeyboardButton('Updates', url="https://t.me/TMWAD"),
InlineKeyboardButton('About', callback_data='about_kt')
],[
InlineKeyboardButton('🏠 Home', callback_data='start_kt'),
InlineKeyboardButton('🔐 Close', callback_data='close_kt')
]]
reply_markup = InlineKeyboardMarkup(buttons)
await query.message.edit_text(
text=Translation.HELP_USER.format(query.from_user.mention),
reply_markup=reply_markup,
disable_web_page_preview=True,
parse_mode='html'
)
elif query.data == "close_kt":
await query.message.delete()
elif query.data == "start_kt":
buttons = [[
InlineKeyboardButton('Help', callback_data='help_kt'),
InlineKeyboardButton('🤖 Updates', url="https://t.me/TMWAD")
]]
reply_markup = InlineKeyboardMarkup(buttons)
await query.message.edit_text(
text=Translation.START_TEXT.format(query.from_user.mention),
reply_markup=reply_markup,
disable_web_page_preview=True,
parse_mode='html'
)
if query.data == "about_kt":
buttons = [[
InlineKeyboardButton('🦸 Deverloper', url='https://github.com/kalanakt')
],[
InlineKeyboardButton('🏠 Home', callback_data='start_kt'),
InlineKeyboardButton('🔐 Close', callback_data='close_kt')
]]
reply_markup = InlineKeyboardMarkup(buttons)
await query.message.edit_text(
text=Translation.ABOUT_MSG.format(query.from_user.mention),
reply_markup=reply_markup,
disable_web_page_preview=True,
parse_mode='html'
)