Spaces:
Running
Running
Update plugins/_help.py
Browse files- plugins/_help.py +31 -29
plugins/_help.py
CHANGED
@@ -1,38 +1,40 @@
|
|
1 |
# Ultroid - UserBot
|
2 |
-
# Copyright (C) 2021-
|
3 |
#
|
4 |
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
5 |
# PLease read the GNU Affero General Public License in
|
6 |
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
from telethon.errors.rpcerrorlist import (
|
9 |
BotInlineDisabledError,
|
10 |
BotMethodInvalidError,
|
11 |
BotResponseTimeoutError,
|
12 |
)
|
13 |
from telethon.tl.custom import Button
|
14 |
-
|
15 |
from xteam.dB._core import HELP, LIST
|
16 |
from xteam.fns.tools import cmd_regex_replace
|
17 |
|
18 |
-
from . import HNDLR, LOGS, OWNER_NAME, asst, get_string, inline_pic, udB, ultroid_cmd
|
19 |
|
20 |
_main_help_menu = [
|
21 |
[
|
22 |
-
Button.inline(
|
23 |
-
Button.inline(get_string("help_5"), data="uh_Addons_"),
|
24 |
-
],
|
25 |
-
[
|
26 |
-
Button.inline(get_string("help_6"), data="uh_VCBot_"),
|
27 |
-
Button.inline(get_string("help_7"), data="inlone"),
|
28 |
],
|
29 |
-
|
30 |
-
Button.inline(get_string("help_8"), data="ownr"),
|
31 |
-
Button.url(
|
32 |
-
get_string("help_9"), url=f"https://t.me/{asst.me.username}?start=set"
|
33 |
-
),
|
34 |
-
],
|
35 |
-
[Button.inline(get_string("help_10"), data="close")],
|
36 |
]
|
37 |
|
38 |
|
@@ -46,28 +48,28 @@ async def _help(ult):
|
|
46 |
output = f"**Plugin** - `{plug}`\n"
|
47 |
for i in HELP["Official"][plug]:
|
48 |
output += i
|
49 |
-
output += "\n
|
50 |
-
await ult.eor(output)
|
51 |
elif HELP.get("Addons") and plug in HELP["Addons"]:
|
52 |
output = f"**Plugin** - `{plug}`\n"
|
53 |
for i in HELP["Addons"][plug]:
|
54 |
output += i
|
55 |
-
output += "\n
|
56 |
await ult.eor(output)
|
57 |
elif HELP.get("VCBot") and plug in HELP["VCBot"]:
|
58 |
output = f"**Plugin** - `{plug}`\n"
|
59 |
for i in HELP["VCBot"][plug]:
|
60 |
output += i
|
61 |
-
output += "\n
|
62 |
-
await ult.eor(output)
|
63 |
else:
|
64 |
try:
|
65 |
x = get_string("help_11").format(plug)
|
66 |
for d in LIST[plug]:
|
67 |
-
x +=
|
68 |
x += "\n"
|
69 |
-
x += "\n
|
70 |
-
await ult.eor(x)
|
71 |
except BaseException:
|
72 |
file = None
|
73 |
compare_strings = []
|
@@ -91,7 +93,7 @@ async def _help(ult):
|
|
91 |
if best_match:
|
92 |
text += f"\nDid you mean `{best_match}`?"
|
93 |
return await ult.eor(text)
|
94 |
-
output = f"
|
95 |
if file in HELP["Official"]:
|
96 |
for i in HELP["Official"][file]:
|
97 |
output += i
|
@@ -101,14 +103,14 @@ async def _help(ult):
|
|
101 |
elif HELP.get("VCBot") and file in HELP["VCBot"]:
|
102 |
for i in HELP["VCBot"][file]:
|
103 |
output += i
|
104 |
-
output += "\n
|
105 |
-
await ult.eor(output)
|
106 |
except BaseException as er:
|
107 |
LOGS.exception(er)
|
108 |
await ult.eor("Error 🤔 occured.")
|
109 |
else:
|
110 |
try:
|
111 |
-
results = await ult.client.inline_query(asst.me.username, "
|
112 |
except BotMethodInvalidError:
|
113 |
z = []
|
114 |
for x in LIST.values():
|
@@ -133,4 +135,4 @@ async def _help(ult):
|
|
133 |
except BotInlineDisabledError:
|
134 |
return await ult.eor(get_string("help_3"))
|
135 |
await results[0].click(chat.id, reply_to=ult.reply_to_msg_id, hide_via=True)
|
136 |
-
await ult.delete()
|
|
|
1 |
# Ultroid - UserBot
|
2 |
+
# Copyright (C) 2021-2023 TeamUltroid
|
3 |
#
|
4 |
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
5 |
# PLease read the GNU Affero General Public License in
|
6 |
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
|
7 |
|
8 |
+
import base64
|
9 |
+
import inspect
|
10 |
+
from datetime import datetime
|
11 |
+
from html import unescape
|
12 |
+
from random import choice
|
13 |
+
from re import compile as re_compile
|
14 |
+
|
15 |
+
from bs4 import BeautifulSoup as bs
|
16 |
+
from telethon import Button
|
17 |
+
from telethon.tl.alltlobjects import LAYER, tlobjects
|
18 |
+
from telethon.tl.types import DocumentAttributeAudio as Audio
|
19 |
+
from telethon.tl.types import InputWebDocument as wb
|
20 |
+
|
21 |
from telethon.errors.rpcerrorlist import (
|
22 |
BotInlineDisabledError,
|
23 |
BotMethodInvalidError,
|
24 |
BotResponseTimeoutError,
|
25 |
)
|
26 |
from telethon.tl.custom import Button
|
27 |
+
from assistant import *
|
28 |
from xteam.dB._core import HELP, LIST
|
29 |
from xteam.fns.tools import cmd_regex_replace
|
30 |
|
31 |
+
from . import HNDLR, LOGS, OWNER_NAME, asst, get_string, inline_pic, udB, ultroid_cmd, call_back, callback, def_logs, eor, get_string, heroku_logs, in_pattern
|
32 |
|
33 |
_main_help_menu = [
|
34 |
[
|
35 |
+
Button.inline("🏡 Modules 🏡", data="uh_Official_"),
|
|
|
|
|
|
|
|
|
|
|
36 |
],
|
37 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
]
|
39 |
|
40 |
|
|
|
48 |
output = f"**Plugin** - `{plug}`\n"
|
49 |
for i in HELP["Official"][plug]:
|
50 |
output += i
|
51 |
+
output += "\n@xteam_cloner"
|
52 |
+
await ult.eor(f"<blockquote>{output}</blockquote>", parse_mode="html")
|
53 |
elif HELP.get("Addons") and plug in HELP["Addons"]:
|
54 |
output = f"**Plugin** - `{plug}`\n"
|
55 |
for i in HELP["Addons"][plug]:
|
56 |
output += i
|
57 |
+
output += "\n@xteam_cloner"
|
58 |
await ult.eor(output)
|
59 |
elif HELP.get("VCBot") and plug in HELP["VCBot"]:
|
60 |
output = f"**Plugin** - `{plug}`\n"
|
61 |
for i in HELP["VCBot"][plug]:
|
62 |
output += i
|
63 |
+
output += "\n@xteam_cloner"
|
64 |
+
await ult.eor(f"<blockquote>{output}</blockquote>", parse_mode="html")
|
65 |
else:
|
66 |
try:
|
67 |
x = get_string("help_11").format(plug)
|
68 |
for d in LIST[plug]:
|
69 |
+
x += "" + d
|
70 |
x += "\n"
|
71 |
+
x += "\n@xteam_cloner"
|
72 |
+
await ult.eor(f"<blockquote>{x}</blockquote>", parse_mode="html")
|
73 |
except BaseException:
|
74 |
file = None
|
75 |
compare_strings = []
|
|
|
93 |
if best_match:
|
94 |
text += f"\nDid you mean `{best_match}`?"
|
95 |
return await ult.eor(text)
|
96 |
+
output = f"Command {plug} found in plugin - {file}\n"
|
97 |
if file in HELP["Official"]:
|
98 |
for i in HELP["Official"][file]:
|
99 |
output += i
|
|
|
103 |
elif HELP.get("VCBot") and file in HELP["VCBot"]:
|
104 |
for i in HELP["VCBot"][file]:
|
105 |
output += i
|
106 |
+
output += "\n@xteam_cloner"
|
107 |
+
await ult.eor(f"<blockquote>{output}</blockquote>", parse_mode="html")
|
108 |
except BaseException as er:
|
109 |
LOGS.exception(er)
|
110 |
await ult.eor("Error 🤔 occured.")
|
111 |
else:
|
112 |
try:
|
113 |
+
results = await ult.client.inline_query(asst.me.username, "help")
|
114 |
except BotMethodInvalidError:
|
115 |
z = []
|
116 |
for x in LIST.values():
|
|
|
135 |
except BotInlineDisabledError:
|
136 |
return await ult.eor(get_string("help_3"))
|
137 |
await results[0].click(chat.id, reply_to=ult.reply_to_msg_id, hide_via=True)
|
138 |
+
await ult.delete()
|