# 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 # . from pyUltroid.dB.database import Var from support import * from telethon.errors.rpcerrorlist import BotInlineDisabledError as dis from telethon.errors.rpcerrorlist import BotMethodInvalidError as bmi from telethon.errors.rpcerrorlist import BotResponseTimeoutError as rep from . import * @ultroid_cmd( pattern="help ?(.*)", ) async def ult(ult): plug = ult.pattern_match.group(1) tgbot = Var.BOT_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" 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 rep: return await eor( ult, get_string("help_2").format(HNDLR), ) except dis: return await eor(ult, get_string("help_3")) except bmi: return await eor( ult, get_string("help_4").format(tgbot), ) await results[0].click(ult.chat_id, reply_to=ult.reply_to_msg_id, hide_via=True) await ult.delete()