Files
Ultroid-fork/plugins/_help.py
Danish 6cc2e1907c Ultroid v0.0.7 Fixes 24/05
ChangeLog - https://t.me/TheUltroid/44

Co-authored-by: Anonymous <69723581+New-dev0@users.noreply.github.com>
Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com>
Co-authored-by: 1Danish-00 <danish@ultroid.tech>
2021-05-24 20:09:49 +05:30

87 lines
3.1 KiB
Python
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
from support import *
from telethon.errors.rpcerrorlist import BotInlineDisabledError as dis
from telethon.errors.rpcerrorlist import BotMethodInvalidError
from telethon.errors.rpcerrorlist import BotResponseTimeoutError as rep
from telethon.tl.custom import Button
from . import *
@ultroid_cmd(
pattern="help ?(.*)",
)
async def ult(ult):
plug = ult.pattern_match.group(1)
tgbot = asst.me.username
if plug:
try:
if plug in HELP:
output = f"**Plugin** - `{plug}`\n"
for i in HELP[plug]:
output += i
output += "\n© @TeamUltroid"
await eor(ult, output)
elif plug in CMD_HELP:
kk = f"Plugin Name-{plug}\n\n✘ Commands Available -\n\n"
kk += str(CMD_HELP[plug])
await eor(ult, kk)
else:
try:
x = f"Plugin Name-{plug}\n\n✘ Commands Available -\n\n"
for d in LIST[plug]:
x += HNDLR + d
x += "\n"
x += "\n© @TeamUltroid"
await eor(ult, x)
except BaseException:
await eod(ult, get_string("help_1").format(plug), time=5)
except BaseException:
await eor(ult, "Error 🤔 occured.")
else:
try:
results = await ultroid_bot.inline_query(tgbot, "ultd")
except BotMethodInvalidError:
z = []
for x in LIST.values():
for y in x:
z.append(y)
cmd = len(z) + 10
bnn = asst.me.username
return await ultroid_bot.send_message(
ult.chat_id,
get_string("inline_4").format(
OWNER_NAME,
len(PLUGINS) - 5,
len(ADDONS),
cmd,
),
buttons=[
[
Button.inline("• Pʟɢɪɴs", data="hrrrr"),
Button.inline("• Aᴅᴅɴs", data="frrr"),
],
[
Button.inline("Oɴᴇʀ•ᴛʟ", data="ownr"),
Button.inline("Iɴʟɪɴᴇ•Pʟɢɪɴs", data="inlone"),
],
[Button.url("Sᴇᴛᴛɪɴɢs⚙", url=f"https://t.me/{bnn}?start=set")],
[Button.inline("••Cʟᴇ••", data="close")],
],
)
except rep:
return await eor(
ult,
get_string("help_2").format(HNDLR),
)
except dis:
return await eor(ult, get_string("help_3"))
await results[0].click(ult.chat_id, reply_to=ult.reply_to_msg_id, hide_via=True)
await ult.delete()