v0.2 11/10/2021

Co-authored-by: New-dev0 <New-dev0@users.noreply.github.com>
Co-authored-by: Amit Sharma <buddhhu@users.noreply.github.com>
Co-authored-by: TechiError <techierror@users.noreply.github.com>
Co-authored-by: Aditya <me@xditya.me>
Co-authored-by: Sonya Nikiforova <Sonniki@users.noreply.github.com>
Co-authored-by: M̲αραт <Marty2509@users.noreply.github.com>
Co-authored-by: Muhamad Risman Aziz <mrismanaziz@users.noreply.github.com>
Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com>
Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com>
Co-authored-by: sppidy <sppidy@users.noreply.github.com>
This commit is contained in:
1Danish-00
2021-10-11 00:27:23 +05:30
parent 8f28387fb3
commit 6f44b386aa
165 changed files with 5537 additions and 4155 deletions

View File

@@ -5,30 +5,33 @@
# 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 pyUltroid.dB._core import HELP, LIST
from telethon.errors.rpcerrorlist import (
BotInlineDisabledError,
BotMethodInvalidError,
BotResponseTimeoutError,
)
from telethon.tl.custom import Button
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(get_string("help_4"), data="hrrrr"),
Button.inline(get_string("help_5"), data="frrr"),
],
[
Button.inline("••Voice Chat", data="vc_helper"),
Button.inline("Inline Plugins••", data="inlone"),
Button.inline(get_string("help_6"), data="vc_helper"),
Button.inline(get_string("help_7"), data="inlone"),
],
[
Button.inline("⚙️ Owner Tools", data="ownr"),
Button.url("Settings ⚙️", url=f"https://t.me/{asst.me.username}?start=set"),
Button.inline(get_string("help_8"), data="ownr"),
Button.url(
get_string("help_9"), url=f"https://t.me/{asst.me.username}?start=set"
),
],
[Button.inline("••Cʟᴇ••", data="close")],
[Button.inline(get_string("help_10"), data="close")],
]
@@ -37,19 +40,27 @@ async def _help(ult):
plug = ult.pattern_match.group(1)
if plug:
try:
if plug in HELP:
if plug in HELP["Official"]:
output = f"**Plugin** - `{plug}`\n"
for i in HELP[plug]:
for i in HELP["Official"][plug]:
output += i
output += "\n© @TeamUltroid"
await eor(ult, output)
elif HELP.get("Addons") and plug in HELP["Addons"]:
output = f"**Plugin** - `{plug}`\n"
for i in HELP["Addons"][plug]:
output += i
output += "\n© @TeamUltroid"
await eor(ult, output)
elif HELP.get("VCBot") and plug in HELP["VCBot"]:
output = f"**Plugin** - `{plug}`\n"
for i in HELP["VCBot"][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"
x = get_string("help_11").format(plug)
for d in LIST[plug]:
x += HNDLR + d
x += "\n"
@@ -57,12 +68,12 @@ async def _help(ult):
await eor(ult, x)
except BaseException:
await eor(ult, get_string("help_1").format(plug), time=5)
except BaseException:
except BaseException as er:
LOGS.exception(er)
await eor(ult, "Error 🤔 occured.")
else:
tgbot = asst.me.username
try:
results = await ult.client.inline_query(tgbot, "ultd")
results = await ult.client.inline_query(asst.me.username, "ultd")
except BotMethodInvalidError:
z = []
for x in LIST.values():
@@ -74,19 +85,19 @@ async def _help(ult):
return await ult.reply(
get_string("inline_4").format(
OWNER_NAME,
len(PLUGINS) - 5,
len(ADDONS),
len(HELP["Official"]) - 5,
len(HELP["Addons"] if "Addons" in HELP else []),
cmd,
),
file=_file_to_replace,
file=INLINE_PIC,
buttons=_main_help_menu,
)
except rep:
except BotResponseTimeoutError:
return await eor(
ult,
get_string("help_2").format(HNDLR),
)
except dis:
except BotInlineDisabledError:
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()