-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_inhelp.py
441 lines (400 loc) ยท 22.9 KB
/
_inhelp.py
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
from math import ceil
from re import compile
import asyncio
import html
import os
import re
import sys
from telethon import Button, custom, events, functions
from telethon.tl.functions.users import GetFullUserRequest
from telethon.events import InlineQuery, callbackquery
from telethon.sync import custom
from telethon.errors.rpcerrorlist import UserNotParticipantError
from telethon.tl.functions.channels import GetParticipantRequest
from telethon.tl.functions.channels import JoinChannelRequest
from telethon.tl.functions.messages import ExportChatInviteRequest
from . import *
d3vil_row = Config.BUTTONS_IN_HELP
d3vil_emoji = Config.EMOJI_IN_HELP
d3vil_pic = Config.PMPERMIT_PIC or "https://telegra.ph/file/ad8abbfbcb2f93f91b10f.jpg"
cstm_pmp = Config.CUSTOM_PMPERMIT
ALV_PIC = Config.ALIVE_PIC
PM_WARNS = {}
PREV_REPLY_MESSAGE = {}
mybot = Config.BOT_USERNAME
if mybot.startswith("@"):
botname = mybot
else:
botname = f"@{mybot}"
LOG_GP = Config.LOGGER_ID
mssge = (
str(cstm_pmp)
if cstm_pmp
else "**๐ธ๐๐ ๐ง๐บ๐๐พ ๐ณ๐๐พ๐๐๐บ๐๐๐พ๐ฝ ๐ณ๐ ๐ฌ๐ ๐ฌ๐บ๐๐๐พ๐'๐ ๐ฏ๐ฌ!\n๐ณ๐๐๐ ๐จ๐ ๐จ๐
๐
๐พ๐๐บ๐
๐ ๐๐ฝ ๐ฑ๐พ๐๐บ๐๐ฝ๐พ๐ฝ ๐ ๐ ๐ข๐๐๐๐พ.**"
)
USER_BOT_WARN_ZERO = "๐ธ๐๐ ๐๐พ๐๐พ ๐๐๐บ๐๐๐๐๐ ๐๐ ๐๐๐พ๐พ๐ ๐๐บ๐๐๐พ๐'๐ ๐๐๐ป๐๐, ๐๐พ๐๐ผ๐พ๐ฟ๐๐๐๐ ๐๐๐ ๐๐บ๐๐พ ๐ป๐พ๐พ๐ ๐ป๐
๐๐ผ๐๐พ๐ฝ ๐ป๐ ๐๐ ๐๐บ๐๐๐พ๐'๐ ๐ฃ3๐๐๐
๐ก๐๐.**\n__๐ญ๐๐ ๐ฆ๐ณ๐ฅ๐ฎ, ๐'๐ ๐ป๐๐๐**"
D3VIL_FIRST = (
"**Hello, ๐ณ๐๐๐ ๐๐ แช3แแฅแแฐแงแ ๐ด๐
๐๐๐บ ๐ฏ๐๐๐๐บ๐๐พ ๐ฒ๐พ๐ผ๐๐๐๐๐ ๐ฏ๐๐๐๐๐ผ๐๐
โ ๏ธ **\n ๐ณ๐๐๐ ๐๐ ๐๐ ๐๐๐ฟ๐๐๐ ๐๐๐ ๐๐๐บ๐ "
"{} ๐๐ ๐ผ๐๐๐๐พ๐๐๐
๐ ๐๐๐บ๐๐บ๐๐
๐บ๐ป๐
๐พ. ๐ณ๐๐๐ ๐๐ ๐บ๐ ๐บ๐๐๐๐๐บ๐๐พ๐ฝ ๐๐พ๐๐๐บ๐๐พ.\n\n"
"{}\n\n**๐ฏ๐
๐พ๐บ๐๐พ ๐ข๐๐๐๐๐พ ๐ถ๐๐ ๐ธ๐๐ ๐ ๐๐พ Inbox ๐!!**".format(d3vil_mention, mssge))
alive_txt = """
**โ๏ธ ๐3๐๐๐๐๐๐ ๐๐ ๐๐๐๐๐๐ โ๏ธ**
{}
**โผ๐ ๐๐ฆ๐ง๐๐ฅโ :** **ใ{}ใ**
**โโโโโโโโโโโโโโโโโโโโ
**โ โณโ ๐ง๐ฒ๐น๐ฒ๐๐ต๐ผ๐ป :** `{}`
**โ โณโ ๐3๐ฉ๐๐๐๐ข๐ง :** **{}**
**โ โณโ ๐จ๐ฝ๐๐ถ๐บ๐ฒ :** `{}`
**โ โณโ ๐๐ฏ๐๐๐ฒ :** **{}**
**โ โณโ ๐ฆ๐๐ฑ๐ผ :** **{}**
**โโโโโโโโโโโโโโโโโโโโ
"""
def button(page, modules):
Row = d3vil_row
Column = 3
modules = sorted([modul for modul in modules if not modul.startswith("_")])
pairs = list(map(list, zip(modules[::3], modules[1::3])))
if len(modules) % 2 == 1:
pairs.append([modules[-1]])
max_pages = ceil(len(pairs) / Row)
pairs = [pairs[i : i + Row] for i in range(0, len(pairs), Row)]
buttons = []
for pairs in pairs[page]:
buttons.append(
[
custom.Button.inline(f"{d3vil_emoji} " + pair + f" {d3vil_emoji}", data=f"Information[{page}]({pair})")
for pair in pairs
]
)
buttons.append(
[
custom.Button.inline(
f"โ๏ธ๏ธ๏ธ ๐ฑ๐ฐ๐ฒ๐บเผ {d3vil_emoji}", data=f"page({(max_pages - 1) if page == 0 else (page - 1)})"
),
custom.Button.inline(
f"โข โ โข", data="close"
),
custom.Button.inline(
f"{d3vil_emoji} เผ๐ฝ๐ด๐๐ โ๏ธ๏ธ๏ธ", data=f"page({0 if page == (max_pages - 1) else page + 1})"
),
]
)
return [max_pages, buttons]
modules = CMD_HELP
if Config.BOT_USERNAME is not None and tgbot is not None:
@tgbot.on(InlineQuery) # pylint:disable=E0602
async def inline_handler(event):
builder = event.builder
result = None
query = event.text
if event.query.user_id == bot.uid and query == "d3vilbot_d3vlp":
rev_text = query[::-1]
veriler = button(0, sorted(CMD_HELP))
apn = []
for x in CMD_LIST.values():
for y in x:
apn.append(y)
result = await builder.article(
f"Hey! Only use .help please",
text=f"**ใ{d3vil_mention}ใ**\n\n๐**๐๐๐๐๐ ๐ผ๐๐๐๐๐๐ ๐ธ๐๐๐๐๐๐๐๐** โญ `{len(CMD_HELP)}` \n๐**Tฮฟฯฮฑโ Cฮฟะผะผฮฑะธโั** โญ `{len(apn)}`\n**๐Pฮฑึาฝโญ** 1/{veriler[0]}",
buttons=veriler[1],
link_preview=False,
)
elif event.query.user_id == bot.uid and query.startswith("fsub"):
hunter = event.pattern_match.group(1)
d3vil = hunter.split("+")
user = await bot.get_entity(int(d3vil[0]))
channel = await bot.get_entity(int(d3vil[1]))
msg = f"**๐ ๐๐พ๐
๐ผ๐๐๐พ** [{user.first_name}](tg://user?id={user.id}), \n\n** ๐ธ๐๐ ๐๐พ๐พ๐ฝ ๐๐ ๐ฉ๐๐๐** {channel.title} **๐๐ ๐ผ๐๐บ๐ ๐๐ ๐๐๐๐ ๐๐๐๐๐.**"
if not channel.username:
link = (await bot(ExportChatInviteRequest(channel))).link
else:
link = "https://t.me/" + channel.username
result = [
await builder.article(
title="force_sub",
text = msg,
buttons=[
[Button.url(text="Channel", url=link)],
[custom.Button.inline("๐ ๐ด๐๐๐๐๐พ ๐ฌ๐พ", data=unmute)],
],
)
]
elif event.query.user_id == bot.uid and query == "alive":
kr_ish = alive_txt.format(Config.ALIVE_MSG, d3vil_mention, tel_ver, d3vil_ver, uptime, abuse_m, is_sudo)
alv_btn = [
[Button.url(f"{D3VIL_USER}", f"tg://openmessage?user_id={d3krish}")],
[Button.url("๐ฌ๐ ๐ข๐๐บ๐๐๐พ๐
", f"https://t.me/{my_channel}"),
Button.url("๐ฌ๐ ๐ฆ๐๐๐๐", f"https://t.me/{my_group}")],
]
if ALV_PIC and ALV_PIC.endswith((".jpg", ".png")):
result = builder.photo(
ALV_PIC,
text=kr_ish,
buttons=alv_btn,
link_preview=False,
)
elif ALV_PIC:
result = builder.document(
ALV_PIC,
text=kr_ish,
title="D3vilBot Alive",
buttons=alv_btn,
link_preview=False,
)
else:
result = builder.article(
text=kr_ish,
title="D3vilBot Alive",
buttons=alv_btn,
link_preview=False,
)
elif event.query.user_id == bot.uid and query == "pm_warn":
d3vl_l = D3VIL_FIRST.format(d3vil_mention, mssge)
result = builder.photo(
file=d3vil_pic,
text=d3vl_l,
buttons=[
[
custom.Button.inline("๐ซ ๐ฒ๐๐บ๐/๐ฒ๐ผ๐บ๐ ๐ซ", data="teamd3"),
custom.Button.inline("๐ฌ ๐ข๐๐บ๐ ๐ฌ", data="chat"),
],
[custom.Button.inline("๐ ๐ฑ๐พ๐๐๐พ๐๐ ๐", data="req")],
[custom.Button.inline("๐ข๐๐๐๐๐๐ โ", data="pmclick")],
],
)
elif event.query.user_id == bot.uid and query == "repo":
result = builder.article(
title="Repository",
text=f"**[โ๏ธ ๐ป๐ด๐ถ๐ด๐ฝ๐ณ๐ฐ๐๐ ๐ฐ๐ต ๐๐ด๐ฐ๐ผ ๐ณ3๐
๐ธ๐ป โ๏ธ](https://t.me/D3VIL_BOT_OFFICIAL)**",
buttons=[
[Button.url("๐ ๐ฑ๐พ๐๐ ๐", "https://github.com/TEAM-D3VIL/D3vilBot")],
[Button.url("๐ ๐ฃ๐พ๐๐
๐๐ ๐", "https://dashboard.heroku.com/new?button-url=https%3A%2F%2Fgithub.com%2FTEAM-D3VIL%2FD3vilBot&template=https%3A%2F%2Fgithub.com%2FTEAM-D3VIL%2FD3vilBot")],
[Button.url("โต ๐ฎ๐๐๐พ๐ โต", "https://t.me/D3_krish")],
],
)
elif query.startswith("http"):
part = query.split(" ")
result = builder.article(
"File uploaded",
text=f"**๐ฅ๐๐
๐พ ๐๐๐
๐๐บ๐ฝ๐พ๐ฝ ๐๐๐ผ๐ผ๐พ๐๐๐ฟ๐๐
๐
๐ ๐๐ {part[2]} site.\๐๐ด๐๐
๐๐ฝ๐พ๐ฝ ๐ณ๐๐๐พ : {part[1][:3]} ๐๐พ๐ผ๐๐๐ฝ\n[โโโ โ]({part[0]})",
buttons=[[custom.Button.url("URL", part[0])]],
link_preview=True,
)
else:
result = builder.article(
"D3VIL_BOT_OFFICIAL",
text="""**๐ง๐พ๐! ๐ณ๐๐๐ ๐๐ [โโข๐ณ3๐
๐ธ๐ป๐ฑ๐พ๐โขโ](https://t.me/D3VIL_OP_BOLTE) \๐๐ธ๐๐ ๐ผ๐บ๐ ๐๐๐๐ ๐๐๐๐พ ๐บ๐ป๐๐๐ ๐๐พ ๐ฟ๐๐๐ ๐๐๐พ ๐
๐๐๐๐ ๐๐๐๐พ๐ ๐ป๐พ๐
๐๐ ๐**""",
buttons=[
[
custom.Button.url("๐ฅ ๐ฒ๐ท๐ฐ๐ฝ๐ฝ๐ด๐ป ๐ฅ", "https://t.me/D3VIL_BOT_OFFICIAL"),
custom.Button.url(
"โก ๐ถ๐๐พ๐๐ฟ โก", "https://t.me/D3VIL_BOT_SUPPORT"
),
],
[
custom.Button.url(
"โจ ๐๐ด๐ฟ๐พ โจ", "https://github.com/D3KRISH/D3vilBot"),
custom.Button.url
(
"๐ฐ ๐พ๐๐ฝ๐ด๐ ๐ฐ", "https://t.me/D3_krish"
)
],
],
link_preview=False,
)
await event.answer([result] if result else None)
@tgbot.on(callbackquery.CallbackQuery(data=compile(b"pmclick")))
async def on_pm_click(event):
if event.query.user_id == bot.uid:
reply_pop_up_alert = "๐ณ๐๐๐ ๐๐ ๐ฟ๐๐ ๐ฎ๐๐๐พ๐ ๐ด๐๐พ๐๐..."
await event.answer(reply_pop_up_alert, cache_time=0, alert=True)
else:
await event.edit(
f" ๐ณ๐๐๐ ๐๐ แช3แแฅแแฐแงแ๐ฏ๐ ๐ฒ๐พ๐ผ๐๐๐๐๐ ๐ฟ๐๐ {d3vil_mention} ๐๐ ๐๐พ๐พ๐ ๐บ๐๐บ๐ ๐๐๐๐บ๐๐๐พ๐ฝ ๐๐พ๐๐บ๐๐ฝ๐ ๐ฟ๐๐๐ ๐๐๐บ๐๐๐๐๐ ๐ฏ๐ฌ..."
)
@tgbot.on(callbackquery.CallbackQuery(data=compile(b"req")))
async def on_pm_click(event):
if event.query.user_id == bot.uid:
reply_pop_up_alert = "๐ณ๐๐๐ ๐๐ ๐ฟ๐๐ ๐๐๐๐พ๐ ๐๐๐พ๐๐!"
await event.answer(reply_pop_up_alert, cache_time=0, alert=True)
else:
await event.edit(
f"โ
**๐ฑ๐พ๐๐๐พ๐๐ ๐ฑ๐พ๐๐๐๐๐พ๐๐พ๐ฝ** \n\n{d3vil_mention} ๐๐๐
๐
๐๐๐ ๐ฝ๐พ๐ผ๐๐ฝ๐พ ๐๐ ๐
๐๐๐ ๐ฟ๐๐ ๐๐๐๐ ๐๐พ๐๐๐พ๐๐ ๐๐ ๐๐๐.\n๐ ๐ณ๐๐
๐
๐๐๐พ๐ ๐๐บ๐๐ ๐บ๐๐ฝ ๐ฝ๐๐'๐ ๐๐๐บ๐!!"
)
target = await event.client(GetFullUserRequest(event.query.user_id))
first_name = html.escape(target.user.first_name)
ok = event.query.user_id
if first_name is not None:
first_name = first_name.replace("\u2060", "")
tosend = f"**๐ ๐ง๐พ๐ {d3vil_mention} !!** \n\nโ๏ธ ๐ธ๐๐ ๐ฆ๐๐ ๐ ๐ฑ๐พ๐๐๐พ๐๐ ๐ฅ๐๐๐ [{first_name}](tg://user?id={ok}) ๐จ๐ ๐ฏ๐!!"
await bot.send_message(LOG_GP, tosend)
@tgbot.on(callbackquery.CallbackQuery(data=compile(b"chat")))
async def on_pm_click(event):
event.query.user_id
if event.query.user_id == bot.uid:
reply_pop_up_alert = "๐ณ๐๐๐ ๐๐ ๐ฟ๐๐ ๐๐๐๐พ๐ ๐๐๐พ๐๐!"
await event.answer(reply_pop_up_alert, cache_time=0, alert=True)
else:
await event.edit(
f"๐ ๐๐!! ๐ธ๐๐ ๐๐พ๐๐พ ๐๐ ๐ฝ๐ chat!!\n ๐ฏ๐
๐พ๐บ๐๐พ ๐๐บ๐๐ ๐ฟ๐๐ {d3vil_mention} ๐๐ ๐ผ๐๐๐พ. ๐ณ๐๐
๐
๐๐๐พ๐ ๐๐พ๐พ๐ ๐๐บ๐๐๐พ๐๐ผ๐พ ๐บ๐๐ฝ ๐ฝ๐๐'๐ ๐๐๐บ๐."
)
target = await event.client(GetFullUserRequest(event.query.user_id))
ok = event.query.user_id
first_name = html.escape(target.user.first_name)
if first_name is not None:
first_name = first_name.replace("\u2060", "")
tosend = f"**๐ ๐ง๐พ๐ {d3vil_mention} !!** \n\n โ๏ธ ๐ธ๐๐ ๐ฆ๐๐ ๐ ๐ฏ๐ฌ ๐ฟ๐๐๐ [{first_name}](tg://user?id={ok}) ๐ฟ๐๐ ๐๐บ๐๐ฝ๐๐ ๐ผ๐๐บ๐๐!!"
await bot.send_message(LOG_GP, tosend)
@tgbot.on(callbackquery.CallbackQuery(data=compile(b"teamd3")))
async def on_pm_click(event):
if event.query.user_id == bot.uid:
reply_pop_up_alert = "๐ณ๐๐๐ ๐๐ ๐ฟ๐๐ ๐๐๐๐พ๐ ๐๐๐พ๐๐!"
await event.answer(reply_pop_up_alert, cache_time=0, alert=True)
else:
await event.edit(
f"๐ฅด **๐ญ๐๐๐บ๐
๐๐บ๐ฝ๐พ๐๐ผ๐๐๐ฝ\n ๐ฏ๐พ๐๐
๐ ๐ฟ๐๐๐๐บ๐ ๐๐พ ๐๐๐๐บ๐
**"
)
await bot(functions.contacts.BlockRequest(event.query.user_id))
target = await event.client(GetFullUserRequest(event.query.user_id))
ok = event.query.user_id
first_name = html.escape(target.user.first_name)
if first_name is not None:
first_name = first_name.replace("\u2060", "")
first_name = html.escape(target.user.first_name)
await bot.send_message(
LOG_GP,
f"**๐ก๐
๐๐ผ๐๐พ๐ฝ** [{first_name}](tg://user?id={ok}) \n\๐๐ฑ๐พ๐บ๐๐๐:- ๐ฒ๐๐บ๐",
)
@tgbot.on(callbackquery.CallbackQuery(data=compile(b"unmute")))
async def on_pm_click(event):
hunter = (event.data_match.group(1)).decode("UTF-8")
d3vil = hunter.split("+")
if not event.sender_id == int(d3vil[0]):
return await event.answer("๐ณ๐๐๐ ๐ ๐๐'๐ ๐ฅ๐๐ ๐ธ๐๐!!", alert=True)
try:
await bot(GetParticipantRequest(int(d3vil[1]), int(d3vil[0])))
except UserNotParticipantError:
return await event.answer(
"You need to join the channel first.", alert=True
)
await bot.edit_permissions(
event.chat_id, int(d3vil[0]), send_message=True, until_date=None
)
await event.edit("๐ธ๐บ๐! ๐ธ๐๐ ๐ผ๐บ๐ ๐ผ๐๐บ๐ ๐๐๐ !!")
@tgbot.on(callbackquery.CallbackQuery(data=compile(b"reopen")))
async def reopn(event):
if event.query.user_id == bot.uid or event.query.user_id in Config.SUDO_USERS:
current_page_number=0
simp = button(current_page_number, CMD_HELP)
veriler = button(0, sorted(CMD_HELP))
apn = []
for x in CMD_LIST.values():
for y in x:
apn.append(y)
await event.edit(
f"**ใ{d3vil_mention}ใ**\n\n๐ **๐๐๐๐๐ ๐ผ๐๐๐๐๐๐ ๐ธ๐๐๐๐๐๐๐๐** โญ `{len(CMD_HELP)}` \n๐ **Tฮฟฯฮฑโ Cฮฟะผะผฮฑะธโั** โญ `{len(apn)}`\n๐ **Pฮฑึาฝ** โญ 1/{veriler[0]}",
buttons=simp[1],
link_preview=False,
)
else:
reply_pop_up_alert = "๐ง๐๐ ๐๐๐บ ๐บ๐๐๐บ. ๐ช๐บ๐ป๐๐พ ๐๐บ๐๐บ๐ ๐๐บ๐๐บ๐ ๐ฝ๐บ๐ป๐บ๐พ ๐๐บ๐บ ๐๐๐พ ๐. ๐๐๐๐ฝ๐๐บ ๐ป๐๐บ ๐
๐ ๐๐บ ๐บ๐๐ ๐ผ๐๐๐๐พ ๐๐. ยฉ แช3แแฅแแฐแงแโข"
await event.answer(reply_pop_up_alert, cache_time=0, alert=True)
@tgbot.on(callbackquery.CallbackQuery(data=compile(b"close")))
async def on_plug_in_callback_query_handler(event):
if event.query.user_id == bot.uid or event.query.user_id in Config.SUDO_USERS:
veriler = custom.Button.inline(f"{d3vil_emoji} Re-Open Menu {d3vil_emoji}", data="reopen")
await event.edit(f"**โ๏ธ แช3vฮนโะฒฯั ๐ฌรชรฑรป ๐ฏ๐รต๐รฎ๐ฝรช๐ รฌ๐ รฑรด๐ ร๐
รถ๐รซ๐ฝ โ๏ธ**\n\n**๐ฌ๐บ๐๐๐พ๐ :** {d3vil_mention}\n\n [ยฉ๏ธ แช3แแฅแแฐแงแโข๏ธ]({chnl_link})", buttons=veriler, link_preview=False)
else:
reply_pop_up_alert = "๐ง๐พ๐
๐
๐ ๐๐๐พ๐๐พ ๐ฃ๐พ๐๐
๐๐ ๐๐๐๐ ๐๐๐ ๐ฃ3๐ต๐จ๐ซ๐ก๐ฎ๐ณ ๐บ๐๐ฝ ๐๐๐พ. ยฉ แช3แแฅแแฐแงแโข"
await event.answer(reply_pop_up_alert, cache_time=0, alert=True)
@tgbot.on(callbackquery.CallbackQuery(data=compile(b"page\((.+?)\)")))
async def page(event):
page = int(event.data_match.group(1).decode("UTF-8"))
veriler = button(page, CMD_HELP)
apn = []
for x in CMD_LIST.values():
for y in x:
apn.append(y)
if event.query.user_id == bot.uid or event.query.user_id in Config.SUDO_USERS:
await event.edit(
f" **ใ{d3vil_mention}ใ**\n\n๐**๐๐๐๐๐ ๐ผ๐๐๐๐๐๐ ๐ธ๐๐๐๐๐๐๐๐** โญ `{len(CMD_HELP)}` \n๐ **Tฮฟฯฮฑโ Cฮฟะผะผฮฑะธโั** โญ `{len(apn)}`\n๐ **Pฮฑึาฝ** โญ 1/{veriler[0]}",
buttons=veriler[1],
link_preview=False,
)
else:
return await event.answer(
"๐ง๐พ๐
๐
๐ ๐๐๐พ๐๐พ ๐ฃ๐พ๐๐
๐๐ ๐๐๐๐ ๐๐๐ ๐ฃ3๐ต๐จ๐ซ๐ก๐ฎ๐ณ ๐บ๐๐ฝ ๐๐๐พ. ยฉ แช3แแฅแแฐแงแโข",
cache_time=0,
alert=True,
)
@tgbot.on(
callbackquery.CallbackQuery(data=compile(b"Information\[(\d*)\]\((.*)\)"))
)
async def Information(event):
page = int(event.data_match.group(1).decode("UTF-8"))
commands = event.data_match.group(2).decode("UTF-8")
try:
buttons = [
custom.Button.inline(
"โ " + cmd[0] + " โ", data=f"commands[{commands}[{page}]]({cmd[0]})"
)
for cmd in CMD_HELP_BOT[commands]["commands"].items()
]
except KeyError:
return await event.answer(
"๐ญ๐ ๐ฃ๐พ๐๐ผ๐๐๐๐๐๐๐ ๐๐ ๐๐๐๐๐๐พ๐ ๐ฟ๐๐ ๐๐๐๐ ๐๐
๐๐๐๐", cache_time=0, alert=True
)
buttons = [buttons[i : i + 2] for i in range(0, len(buttons), 2)]
buttons.append([custom.Button.inline(f"{d3vil_emoji} Main Menu {d3vil_emoji}", data=f"page({page})")])
if event.query.user_id == bot.uid or event.query.user_id in Config.SUDO_USERS:
await event.edit(
f"**๐ ๐ฅ๐๐
๐พ :** `{commands}`\n**๐ข ๐ญ๐๐๐ป๐พ๐ ๐๐ฟ ๐ผ๐๐๐๐บ๐๐ฝ๐ :** `{len(CMD_HELP_BOT[commands]['commands'])}`",
buttons=buttons,
link_preview=False,
)
else:
return await event.answer(
"๐ง๐พ๐
๐
๐ ๐๐๐พ๐๐พ ๐ฃ๐พ๐๐
๐๐ ๐๐๐๐ ๐๐๐ ๐ฃ3๐ต๐จ๐ซ๐ก๐ฎ๐ณ ๐บ๐๐ฝ ๐๐๐พ. ยฉ แช3แแฅแแฐแงแโข",
cache_time=0,
alert=True,
)
@tgbot.on(
callbackquery.CallbackQuery(data=compile(b"commands\[(.*)\[(\d*)\]\]\((.*)\)"))
)
async def commands(event):
cmd = event.data_match.group(1).decode("UTF-8")
page = int(event.data_match.group(2).decode("UTF-8"))
commands = event.data_match.group(3).decode("UTF-8")
result = f"**๐ ๐ฅ๐๐
๐พ :** `{cmd}`\n"
if CMD_HELP_BOT[cmd]["info"]["info"] == "":
if not CMD_HELP_BOT[cmd]["info"]["warning"] == "":
result += f"**โ ๏ธ ๐ถ๐บ๐๐๐๐๐ :** {CMD_HELP_BOT[cmd]['info']['warning']}\n\n"
else:
if not CMD_HELP_BOT[cmd]["info"]["warning"] == "":
result += f"**โ ๏ธ ๐ถ๐บ๐๐๐๐๐ :** {CMD_HELP_BOT[cmd]['info']['warning']}\n"
result += f"**โน๏ธ ๐จ๐๐ฟ๐ :** {CMD_HELP_BOT[cmd]['info']['info']}\n\n"
command = CMD_HELP_BOT[cmd]["commands"][commands]
if command["params"] is None:
result += f"**๐ ๐ข๐๐๐๐บ๐๐ฝ๐ :** `{HANDLER[:1]}{command['command']}`\n"
else:
result += f"**๐ ๐ข๐๐๐๐บ๐๐ฝ๐ :** `{HANDLER[:1]}{command['command']} {command['params']}`\n"
if command["example"] is None:
result += f"**๐ฌ ๐ค๐๐๐
๐บ๐๐บ๐๐๐๐ :** `{command['usage']}`\n\n"
else:
result += f"**๐ฌ ๐ค๐๐๐
๐บ๐๐บ๐๐๐๐ :** `{command['usage']}`\n"
result += f"**โจ๏ธ ๐ฅ๐๐ ๐ค๐๐บ๐๐๐
๐พ :** `{HANDLER[:1]}{command['example']}`\n\n"
if event.query.user_id == bot.uid or event.query.user_id in Config.SUDO_USERS:
await event.edit(
result,
buttons=[
custom.Button.inline(f"{d3vil_emoji} Return {d3vil_emoji}", data=f"Information[{page}]({cmd})")
],
link_preview=False,
)
else:
return await event.answer(
"๐ง๐พ๐
๐
๐ ๐๐๐พ๐๐พ ๐ฃ๐พ๐๐
๐๐ ๐๐๐๐ ๐๐๐ ๐ฃ3๐ต๐จ๐ซ๐ก๐ฎ๐ณ ๐บ๐๐ฝ ๐๐๐พ. ยฉ แช3แแฅแแฐแงแโข",
cache_time=0,
alert=True,
)