Files
Ultroid-fork/plugins/_help.py
Devesh Pal 6c7af44f09 Ultroid v0.1 Updates 13.09.2021
Co-authored-by: Danish <danish@ultroid.tech>
Co-authored-by: Aditya <me@xditya.me>
Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com>
Co-authored-by: sppidy <sppidy@users.noreply.github.com>
Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com>
Co-authored-by: divkix <divkix@users.noreply.github.com>
Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com>
Co-authored-by: Programming Error <error@notavailable.live>
2021-09-13 01:03:39 +05:30

93 lines
3.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
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) 2021 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 pyUltroid.dB.core import *
from telethon.errors.rpcerrorlist import BotInlineDisabledError as dis
from telethon.errors.rpcerrorlist import BotMethodInvalidError
from telethon.errors.rpcerrorlist import BotResponseTimeoutError as rep
from . import *
C_PIC = udB.get("INLINE_PIC")
_file_to_replace = C_PIC or "resources/extras/inline.jpg"
_main_help_menu = [
[
Button.inline("• Plugins", data="hrrrr"),
Button.inline("• Addons", data="frrr"),
],
[
Button.inline("••Voice Chat", data="vc_helper"),
Button.inline("Inline Plugins••", data="inlone"),
],
[
Button.inline("⚙️ Owner Tools", data="ownr"),
Button.url("Settings ⚙️", url=f"https://t.me/{asst.me.username}?start=set"),
],
[Button.inline("••Cʟᴇ••", data="close")],
]
@ultroid_cmd(pattern="help ?(.*)")
async def _help(ult):
plug = ult.pattern_match.group(1)
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 eor(ult, get_string("help_1").format(plug), time=5)
except BaseException:
await eor(ult, "Error 🤔 occured.")
else:
tgbot = asst.me.username
try:
results = await ult.client.inline_query(tgbot, "ultd")
except BotMethodInvalidError:
z = []
for x in LIST.values():
for y in x:
z.append(y)
cmd = len(z) + 10
if udB.get("MANAGER") and udB.get("DUAL_HNDLR") == "/":
_main_help_menu[2:3] = [[Button.inline("• Manager Help •", "mngbtn")]]
return await ult.reply(
get_string("inline_4").format(
OWNER_NAME,
len(PLUGINS) - 5,
len(ADDONS),
cmd,
),
file=_file_to_replace,
buttons=_main_help_menu,
)
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()