Spaces:
Paused
Paused
Captain Ezio
commited on
Commit
Β·
1605ecb
1
Parent(s):
89c3556
Removed multi lang
Browse files- Powers/utils/custom_filters.py +3 -4
- Powers/utils/start_utils.py +15 -12
Powers/utils/custom_filters.py
CHANGED
|
@@ -9,7 +9,6 @@ from pyrogram.types import CallbackQuery, Message
|
|
| 9 |
|
| 10 |
from Powers import DEV_USERS, OWNER_ID, SUDO_USERS
|
| 11 |
from Powers.database.disable_db import DISABLED_CMDS
|
| 12 |
-
from Powers.tr_engine import tlang
|
| 13 |
from Powers.utils.caching import ADMIN_CACHE, admin_cache_reload
|
| 14 |
from Powers.vars import Config
|
| 15 |
|
|
@@ -169,7 +168,7 @@ async def admin_check_func(_, __, m: Message or CallbackQuery):
|
|
| 169 |
if m.from_user.id in admin_group:
|
| 170 |
return True
|
| 171 |
|
| 172 |
-
await m.reply_text(
|
| 173 |
|
| 174 |
return False
|
| 175 |
|
|
@@ -219,7 +218,7 @@ async def restrict_check_func(_, __, m: Message or CallbackQuery):
|
|
| 219 |
status = True
|
| 220 |
else:
|
| 221 |
status = False
|
| 222 |
-
await m.reply_text(
|
| 223 |
|
| 224 |
return status
|
| 225 |
|
|
@@ -242,7 +241,7 @@ async def promote_check_func(_, __, m):
|
|
| 242 |
status = True
|
| 243 |
else:
|
| 244 |
status = False
|
| 245 |
-
await m.reply_text(
|
| 246 |
|
| 247 |
return status
|
| 248 |
|
|
|
|
| 9 |
|
| 10 |
from Powers import DEV_USERS, OWNER_ID, SUDO_USERS
|
| 11 |
from Powers.database.disable_db import DISABLED_CMDS
|
|
|
|
| 12 |
from Powers.utils.caching import ADMIN_CACHE, admin_cache_reload
|
| 13 |
from Powers.vars import Config
|
| 14 |
|
|
|
|
| 168 |
if m.from_user.id in admin_group:
|
| 169 |
return True
|
| 170 |
|
| 171 |
+
await m.reply_text(text="You cannot use an admin command!")
|
| 172 |
|
| 173 |
return False
|
| 174 |
|
|
|
|
| 218 |
status = True
|
| 219 |
else:
|
| 220 |
status = False
|
| 221 |
+
await m.reply_text(text="You don't have permissions to restrict members!")
|
| 222 |
|
| 223 |
return status
|
| 224 |
|
|
|
|
| 241 |
status = True
|
| 242 |
else:
|
| 243 |
status = False
|
| 244 |
+
await m.reply_text(text="You don't have permission to promote members!")
|
| 245 |
|
| 246 |
return status
|
| 247 |
|
Powers/utils/start_utils.py
CHANGED
|
@@ -10,7 +10,6 @@ from Powers.bot_class import Gojo
|
|
| 10 |
from Powers.database.chats_db import Chats
|
| 11 |
from Powers.database.notes_db import Notes
|
| 12 |
from Powers.database.rules_db import Rules
|
| 13 |
-
from Powers.tr_engine import tlang
|
| 14 |
from Powers.utils.cmd_senders import send_cmd
|
| 15 |
from Powers.utils.kbhelpers import ikb
|
| 16 |
from Powers.utils.msg_types import Types
|
|
@@ -31,7 +30,7 @@ async def gen_cmds_kb(m: Message or CallbackQuery):
|
|
| 31 |
m = m.message
|
| 32 |
|
| 33 |
cmds = sorted(list(HELP_COMMANDS.keys()))
|
| 34 |
-
kb = [(
|
| 35 |
|
| 36 |
return [kb[i : i + 3] for i in range(0, len(kb), 3)]
|
| 37 |
|
|
@@ -42,21 +41,21 @@ async def gen_start_kb(q: Message or CallbackQuery):
|
|
| 42 |
[
|
| 43 |
[
|
| 44 |
(
|
| 45 |
-
|
| 46 |
f"https://t.me/{Config.BOT_USERNAME}?startgroup=new",
|
| 47 |
"url",
|
| 48 |
),
|
| 49 |
(
|
| 50 |
-
|
| 51 |
f"https://t.me/{SUPPORT_GROUP}",
|
| 52 |
"url",
|
| 53 |
),
|
| 54 |
],
|
| 55 |
-
[(
|
| 56 |
[
|
| 57 |
-
|
| 58 |
(
|
| 59 |
-
|
| 60 |
"https://github.com/iamgojoof6eyes/Gojo_Satarou",
|
| 61 |
"url",
|
| 62 |
),
|
|
@@ -231,19 +230,23 @@ async def get_help_msg(m: Message or CallbackQuery, help_option: str):
|
|
| 231 |
HELP_COMMANDS[i]["buttons"]
|
| 232 |
for i in HELP_COMMANDS
|
| 233 |
if help_option in HELP_COMMANDS[i]["alt_cmds"]
|
| 234 |
-
) + [[("Β« " +
|
| 235 |
help_msg = (
|
| 236 |
-
f"**{(
|
| 237 |
-
+
|
| 238 |
)
|
| 239 |
LOGGER.info(
|
| 240 |
f"{m.from_user.id} fetched help for {help_option} in {m.chat.id}",
|
| 241 |
)
|
| 242 |
else:
|
| 243 |
-
help_msg =
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
help_kb = [
|
| 245 |
*(await gen_cmds_kb(m)),
|
| 246 |
-
[(
|
| 247 |
]
|
| 248 |
|
| 249 |
return help_msg, help_kb
|
|
|
|
| 10 |
from Powers.database.chats_db import Chats
|
| 11 |
from Powers.database.notes_db import Notes
|
| 12 |
from Powers.database.rules_db import Rules
|
|
|
|
| 13 |
from Powers.utils.cmd_senders import send_cmd
|
| 14 |
from Powers.utils.kbhelpers import ikb
|
| 15 |
from Powers.utils.msg_types import Types
|
|
|
|
| 30 |
m = m.message
|
| 31 |
|
| 32 |
cmds = sorted(list(HELP_COMMANDS.keys()))
|
| 33 |
+
kb = [(f"get_mod.{cmd.lower()}") for cmd in cmds]
|
| 34 |
|
| 35 |
return [kb[i : i + 3] for i in range(0, len(kb), 3)]
|
| 36 |
|
|
|
|
| 41 |
[
|
| 42 |
[
|
| 43 |
(
|
| 44 |
+
"β Add me to a chat!",
|
| 45 |
f"https://t.me/{Config.BOT_USERNAME}?startgroup=new",
|
| 46 |
"url",
|
| 47 |
),
|
| 48 |
(
|
| 49 |
+
"Support π₯",
|
| 50 |
f"https://t.me/{SUPPORT_GROUP}",
|
| 51 |
"url",
|
| 52 |
),
|
| 53 |
],
|
| 54 |
+
[("π Commands & Help", "commands")],
|
| 55 |
[
|
| 56 |
+
|
| 57 |
(
|
| 58 |
+
"ποΈ Source Code",
|
| 59 |
"https://github.com/iamgojoof6eyes/Gojo_Satarou",
|
| 60 |
"url",
|
| 61 |
),
|
|
|
|
| 230 |
HELP_COMMANDS[i]["buttons"]
|
| 231 |
for i in HELP_COMMANDS
|
| 232 |
if help_option in HELP_COMMANDS[i]["alt_cmds"]
|
| 233 |
+
) + [[("Β« " + "Back", "commands")]]
|
| 234 |
help_msg = (
|
| 235 |
+
f"**{(help_option_name['help_msg']).replace('.help', '.main')}:**\n\n"
|
| 236 |
+
+ help_option_value
|
| 237 |
)
|
| 238 |
LOGGER.info(
|
| 239 |
f"{m.from_user.id} fetched help for {help_option} in {m.chat.id}",
|
| 240 |
)
|
| 241 |
else:
|
| 242 |
+
help_msg = """Hey There! My name is Gojo.
|
| 243 |
+
I'm here to help you manage your groups!
|
| 244 |
+
Commands available:
|
| 245 |
+
Γ /start: Start the bot
|
| 246 |
+
Γ /help: Give's you this message."""
|
| 247 |
help_kb = [
|
| 248 |
*(await gen_cmds_kb(m)),
|
| 249 |
+
[("Β« Back", "start_back")],
|
| 250 |
]
|
| 251 |
|
| 252 |
return help_msg, help_kb
|