-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_helper.py
83 lines (71 loc) · 2.64 KB
/
_helper.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
import asyncio
import requests
from telethon import functions
from telethon.errors import ChatSendInlineForbiddenError as noin
from telethon.errors.rpcerrorlist import BotMethodInvalidError as dedbot
from . import *
msg = f"""
**⚡ ℓεgεη∂αяү αғ тεαм ∂3vιℓ ⚡**
• [⚜️ 𝐑𝐞𝐩𝐨 ⚜️](https://github.com/D3KRISH/D3vilBot)
• [⚡ 𝐒𝐮𝐩𝐩𝐨𝐫𝐭 ⚡](https://t.me/D3VIL_BOT_OFFICIAL)
• ©️ {d3vil_channel} ™
"""
botname = Config.BOT_USERNAME
@bot.on(d3vil_cmd(pattern="repo$"))
@bot.on(sudo_cmd(pattern="repo$", allow_sudo=True))
async def repo(event):
try:
d3vil = await bot.inline_query(botname, "repo")
await d3vil[0].click(event.chat_id)
if event.sender_id == d3krish:
await event.delete()
except (noin, dedbot):
await eor(event, msg)
@bot.on(d3vil_cmd(pattern="help ?(.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="help ?(.*)", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
tgbotusername = Config.BOT_USERNAME
input_str = event.pattern_match.group(1)
try:
if not input_str == "":
if input_str in CMD_HELP:
await eor(event, str(CMD_HELP[args]))
except:
pass
if tgbotusername is not None:
results = await event.client.inline_query(tgbotusername, "d3vilbot_d3vlp")
await results[0].click(
event.chat_id, reply_to=event.reply_to_msg_id, hide_via=True
)
await event.delete()
else:
await eor(event, "**⚠️ 𝖤𝖱𝖱𝖮𝖱 !!** \nPlease Re-Check BOT_TOKEN & BOT_USERNAME on Heroku.")
@bot.on(d3vil_cmd(pattern="plinfo(?: |$)(.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="plinfo(?: |$)(.*)", allow_sudo=True))
async def d3vilbott(event):
if event.fwd_from:
return
args = event.pattern_match.group(1).lower()
if args:
if args in CMD_HELP:
await eor(event, str(CMD_HELP[args]))
else:
await eod(event, "**⚠️ 𝖤𝗋𝗋𝗈𝗋 !** \nNeed a module name to show plugin info.")
else:
string = ""
sayfa = [
sorted(list(CMD_HELP))[i : i + 5]
for i in range(0, len(sorted(list(CMD_HELP))), 5)
]
for i in sayfa:
string += f"`▶️ `"
for sira, a in enumerate(i):
string += "`" + str(a)
if sira == i.index(i[-1]):
string += "`"
else:
string += "`, "
string += "\n"
await eod(event, "Please Specify A Module Name Of Which You Want Info" + "\n\n" + string)