Spaces:
Paused
Paused
Captain Ezio
commited on
Commit
·
90bcf5e
1
Parent(s):
77d70b5
fixes and improvements
Browse files- Powers/plugins/dev.py +3 -3
- Powers/plugins/start.py +11 -10
- Powers/utils/start_utils.py +1 -1
- Powers/utils/string.py +2 -2
Powers/plugins/dev.py
CHANGED
|
@@ -9,7 +9,7 @@ from pyrogram.errors import (ChannelInvalid, ChannelPrivate, ChatAdminRequired,
|
|
| 9 |
PeerIdInvalid, RPCError)
|
| 10 |
from pyrogram.types import Message
|
| 11 |
|
| 12 |
-
from Powers import BOT_TOKEN, LOGFILE, LOGGER, MESSAGE_DUMP, UPTIME
|
| 13 |
from Powers.bot_class import Gojo
|
| 14 |
from Powers.database.chats_db import Chats
|
| 15 |
from Powers.utils.clean_file import remove_markdown_and_html
|
|
@@ -118,7 +118,7 @@ async def evaluate_code(c: Gojo, m: Message):
|
|
| 118 |
if (
|
| 119 |
(evaluation.startswith(initial) or evaluation.endswith(end))
|
| 120 |
or (BOT_TOKEN in evaluation)
|
| 121 |
-
) and m.from_user.id !=
|
| 122 |
evaluation = "Bhaag ja bsdk bada aya token nikalne wala"
|
| 123 |
await c.send_message(
|
| 124 |
MESSAGE_DUMP,
|
|
@@ -200,7 +200,7 @@ async def execution(c: Gojo, m: Message):
|
|
| 200 |
for x in xxx:
|
| 201 |
xx = x.split("=")
|
| 202 |
if xx and xx[0] in HARMFUL:
|
| 203 |
-
if m.from_user.id !=
|
| 204 |
out = "You can't access them"
|
| 205 |
await c.send_message(
|
| 206 |
MESSAGE_DUMP,
|
|
|
|
| 9 |
PeerIdInvalid, RPCError)
|
| 10 |
from pyrogram.types import Message
|
| 11 |
|
| 12 |
+
from Powers import BOT_TOKEN, LOGFILE, LOGGER, MESSAGE_DUMP, UPTIME, OWNER_ID
|
| 13 |
from Powers.bot_class import Gojo
|
| 14 |
from Powers.database.chats_db import Chats
|
| 15 |
from Powers.utils.clean_file import remove_markdown_and_html
|
|
|
|
| 118 |
if (
|
| 119 |
(evaluation.startswith(initial) or evaluation.endswith(end))
|
| 120 |
or (BOT_TOKEN in evaluation)
|
| 121 |
+
) and m.from_user.id != OWNER_ID:
|
| 122 |
evaluation = "Bhaag ja bsdk bada aya token nikalne wala"
|
| 123 |
await c.send_message(
|
| 124 |
MESSAGE_DUMP,
|
|
|
|
| 200 |
for x in xxx:
|
| 201 |
xx = x.split("=")
|
| 202 |
if xx and xx[0] in HARMFUL:
|
| 203 |
+
if m.from_user.id != OWNER_ID:
|
| 204 |
out = "You can't access them"
|
| 205 |
await c.send_message(
|
| 206 |
MESSAGE_DUMP,
|
Powers/plugins/start.py
CHANGED
|
@@ -72,6 +72,7 @@ async def start(c: Gojo, m: Message):
|
|
| 72 |
):
|
| 73 |
await get_private_note(c, m, help_option)
|
| 74 |
return
|
|
|
|
| 75 |
if help_option.startswith("rules"):
|
| 76 |
LOGGER.info(f"{m.from_user.id} fetched privaterules in {m.chat.id}")
|
| 77 |
await get_private_rules(c, m, help_option)
|
|
@@ -81,15 +82,15 @@ async def start(c: Gojo, m: Message):
|
|
| 81 |
|
| 82 |
if not help_msg:
|
| 83 |
return
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
try:
|
| 94 |
cpt = f"""
|
| 95 |
Hey [{m.from_user.first_name}](http://t.me/{m.from_user.username})! My self Gojo ✨.
|
|
@@ -233,7 +234,7 @@ Commands available:
|
|
| 233 |
[
|
| 234 |
InlineKeyboardButton(
|
| 235 |
"Help",
|
| 236 |
-
url=f"t.me/{Config.BOT_USERNAME}?start=
|
| 237 |
),
|
| 238 |
],
|
| 239 |
],
|
|
|
|
| 72 |
):
|
| 73 |
await get_private_note(c, m, help_option)
|
| 74 |
return
|
| 75 |
+
|
| 76 |
if help_option.startswith("rules"):
|
| 77 |
LOGGER.info(f"{m.from_user.id} fetched privaterules in {m.chat.id}")
|
| 78 |
await get_private_rules(c, m, help_option)
|
|
|
|
| 82 |
|
| 83 |
if not help_msg:
|
| 84 |
return
|
| 85 |
+
if help_option.split("_")[1] == "help":
|
| 86 |
+
await m.reply_photo(
|
| 87 |
+
photo=str(choice(StartPic)),
|
| 88 |
+
caption=help_msg,
|
| 89 |
+
parse_mode=enums.ParseMode.MARKDOWN,
|
| 90 |
+
reply_markup=help_kb,
|
| 91 |
+
quote=True,
|
| 92 |
+
)
|
| 93 |
+
return
|
| 94 |
try:
|
| 95 |
cpt = f"""
|
| 96 |
Hey [{m.from_user.first_name}](http://t.me/{m.from_user.username})! My self Gojo ✨.
|
|
|
|
| 234 |
[
|
| 235 |
InlineKeyboardButton(
|
| 236 |
"Help",
|
| 237 |
+
url=f"t.me/{Config.BOT_USERNAME}?start=start_help",
|
| 238 |
),
|
| 239 |
],
|
| 240 |
],
|
Powers/utils/start_utils.py
CHANGED
|
@@ -92,7 +92,7 @@ async def get_private_note(c: Gojo, m: Message, help_option: str):
|
|
| 92 |
f"- [{note[0]}](https://t.me/{Config.BOT_USERNAME}?start=note_{chat_id}_{note[1]})"
|
| 93 |
for note in all_notes
|
| 94 |
]
|
| 95 |
-
rply = f"Available notes in {chat_title}"
|
| 96 |
rply += "\n".join(note_list)
|
| 97 |
rply += "\n\nYou can retrieve these notes by tapping on the notename."
|
| 98 |
await m.reply_text(rply, disable_web_page_preview=True, quote=True)
|
|
|
|
| 92 |
f"- [{note[0]}](https://t.me/{Config.BOT_USERNAME}?start=note_{chat_id}_{note[1]})"
|
| 93 |
for note in all_notes
|
| 94 |
]
|
| 95 |
+
rply = f"Available notes in {chat_title}\n"
|
| 96 |
rply += "\n".join(note_list)
|
| 97 |
rply += "\n\nYou can retrieve these notes by tapping on the notename."
|
| 98 |
await m.reply_text(rply, disable_web_page_preview=True, quote=True)
|
Powers/utils/string.py
CHANGED
|
@@ -71,9 +71,9 @@ async def build_keyboard(buttons):
|
|
| 71 |
keyb = []
|
| 72 |
for btn in buttons:
|
| 73 |
if btn[-1] and keyb:
|
| 74 |
-
keyb[-1].append(
|
| 75 |
else:
|
| 76 |
-
keyb.append([
|
| 77 |
|
| 78 |
return keyb
|
| 79 |
|
|
|
|
| 71 |
keyb = []
|
| 72 |
for btn in buttons:
|
| 73 |
if btn[-1] and keyb:
|
| 74 |
+
keyb[-1].append((btn[0], btn[1], "url"))
|
| 75 |
else:
|
| 76 |
+
keyb.append([(btn[0], btn[1], "url")])
|
| 77 |
|
| 78 |
return keyb
|
| 79 |
|