Spaces:
Paused
Paused
Captain Ezio
commited on
Commit
·
4fbd28b
1
Parent(s):
321432c
have to see something
Browse files- Powers/plugins/admin.py +28 -0
- Powers/plugins/start.py +3 -2
- Powers/utils/start_utils.py +6 -10
- README.md +0 -3
- requirements.txt +0 -1
Powers/plugins/admin.py
CHANGED
|
@@ -460,6 +460,30 @@ async def setgtitle(_, m: Message):
|
|
| 460 |
f"Successfully Changed Group Title From {m.chat.title} To {gtit}",
|
| 461 |
)
|
| 462 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 463 |
|
| 464 |
@Gojo.on_message(command("setgdes") & admin_filter)
|
| 465 |
async def setgdes(_, m: Message):
|
|
@@ -556,8 +580,10 @@ __alt_name__ = [
|
|
| 556 |
]
|
| 557 |
__HELP__ = """
|
| 558 |
**Admin**
|
|
|
|
| 559 |
**User Commands:**
|
| 560 |
• /adminlist: List all the admins in the Group.
|
|
|
|
| 561 |
**Admin only:**
|
| 562 |
• /invitelink: Gets chat invitelink.
|
| 563 |
• /promote: Promotes the user replied to or tagged (supports with title).
|
|
@@ -574,3 +600,5 @@ __HELP__ = """
|
|
| 574 |
• /enableall: enable all disabled commands.
|
| 575 |
**Example:**
|
| 576 |
`/promote @username`: this promotes a user to admin."""
|
|
|
|
|
|
|
|
|
| 460 |
f"Successfully Changed Group Title From {m.chat.title} To {gtit}",
|
| 461 |
)
|
| 462 |
|
| 463 |
+
"""@Gojo.on_message(command("contents") & admin_filter)
|
| 464 |
+
async def savecontent(c: Gojo, m: Message):
|
| 465 |
+
user = await m.chat.get_member(m.from_user.id)
|
| 466 |
+
if not (user.privileges.can_restrict_members and user.status in [CMS.OWNER, CMS.ADMINISTRATOR]):
|
| 467 |
+
await m.reply_text(
|
| 468 |
+
"You can't restrict contents here!"
|
| 469 |
+
)
|
| 470 |
+
return
|
| 471 |
+
if len(m.command) < 1:
|
| 472 |
+
return await m.reply_text("Please read /help for using it!")
|
| 473 |
+
todo = m.text.split(None, 1)[1]
|
| 474 |
+
try:
|
| 475 |
+
c.set_chat_protected_content()
|
| 476 |
+
if todo.lower() in ["yes", "true", "on"]:
|
| 477 |
+
await m.chat.set_protected_content(True)
|
| 478 |
+
return await m.reply_text("Now no one can save content from this chat!")
|
| 479 |
+
if todo.lower() in ["no", "false", "off"]:
|
| 480 |
+
await m.chat.set_protected_content(False)
|
| 481 |
+
return await m.reply_text("Now peoples can save content from this chat!")
|
| 482 |
+
return await m.reply_text("**Usage:** `/contents` <yes/on/true> or <off/false/no>\n Do /help admin to know more.")
|
| 483 |
+
except Exception as e:
|
| 484 |
+
LOGGER.error(e)
|
| 485 |
+
LOGGER.error(format_exc())
|
| 486 |
+
return await m.reply_text(f"**Error:**\n{e}")"""
|
| 487 |
|
| 488 |
@Gojo.on_message(command("setgdes") & admin_filter)
|
| 489 |
async def setgdes(_, m: Message):
|
|
|
|
| 580 |
]
|
| 581 |
__HELP__ = """
|
| 582 |
**Admin**
|
| 583 |
+
|
| 584 |
**User Commands:**
|
| 585 |
• /adminlist: List all the admins in the Group.
|
| 586 |
+
|
| 587 |
**Admin only:**
|
| 588 |
• /invitelink: Gets chat invitelink.
|
| 589 |
• /promote: Promotes the user replied to or tagged (supports with title).
|
|
|
|
| 600 |
• /enableall: enable all disabled commands.
|
| 601 |
**Example:**
|
| 602 |
`/promote @username`: this promotes a user to admin."""
|
| 603 |
+
|
| 604 |
+
# • /contents: Restrict saving contents pass `True` to switch on and `false` to off.
|
Powers/plugins/start.py
CHANGED
|
@@ -4,7 +4,8 @@ from pyrogram import enums, filters
|
|
| 4 |
from pyrogram.enums import ChatMemberStatus as CMS
|
| 5 |
from pyrogram.enums import ChatType
|
| 6 |
from pyrogram.errors import MessageNotModified, QueryIdInvalid, UserIsBlocked
|
| 7 |
-
from pyrogram.types import CallbackQuery,
|
|
|
|
| 8 |
|
| 9 |
from Powers import HELP_COMMANDS, LOGGER
|
| 10 |
from Powers.bot_class import Gojo
|
|
@@ -110,7 +111,7 @@ Join my [News Channel](https://t.me/gojo_bots_network) to get information on all
|
|
| 110 |
[
|
| 111 |
InlineKeyboardButton(
|
| 112 |
"Connect me to pm",
|
| 113 |
-
url=f"https://
|
| 114 |
),
|
| 115 |
],
|
| 116 |
],
|
|
|
|
| 4 |
from pyrogram.enums import ChatMemberStatus as CMS
|
| 5 |
from pyrogram.enums import ChatType
|
| 6 |
from pyrogram.errors import MessageNotModified, QueryIdInvalid, UserIsBlocked
|
| 7 |
+
from pyrogram.types import (CallbackQuery, InlineKeyboardButton,
|
| 8 |
+
InlineKeyboardMarkup, Message)
|
| 9 |
|
| 10 |
from Powers import HELP_COMMANDS, LOGGER
|
| 11 |
from Powers.bot_class import Gojo
|
|
|
|
| 111 |
[
|
| 112 |
InlineKeyboardButton(
|
| 113 |
"Connect me to pm",
|
| 114 |
+
url=f"https://{Config.BOT_USERNAME}.t.me/",
|
| 115 |
),
|
| 116 |
],
|
| 117 |
],
|
Powers/utils/start_utils.py
CHANGED
|
@@ -3,7 +3,7 @@ from secrets import choice
|
|
| 3 |
from traceback import format_exc
|
| 4 |
|
| 5 |
from pyrogram.errors import RPCError
|
| 6 |
-
from pyrogram.types import CallbackQuery,
|
| 7 |
|
| 8 |
from Powers import HELP_COMMANDS, LOGGER, SUPPORT_GROUP
|
| 9 |
from Powers.bot_class import Gojo
|
|
@@ -68,6 +68,11 @@ async def gen_start_kb(q: Message or CallbackQuery):
|
|
| 68 |
"https://t.me/psy_Logos",
|
| 69 |
"url",
|
| 70 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
],
|
| 72 |
],
|
| 73 |
)
|
|
@@ -255,14 +260,5 @@ Commands available:
|
|
| 255 |
"""
|
| 256 |
ou = await gen_cmds_kb(m)
|
| 257 |
help_kb = ikb(ou, True)
|
| 258 |
-
"""help_kb = [
|
| 259 |
-
*(await gen_cmds_kb(m)),
|
| 260 |
-
[
|
| 261 |
-
InlineKeyboardButton(
|
| 262 |
-
"« Back",
|
| 263 |
-
callback_data="start_back",
|
| 264 |
-
),
|
| 265 |
-
],
|
| 266 |
-
]"""
|
| 267 |
|
| 268 |
return help_msg, help_kb
|
|
|
|
| 3 |
from traceback import format_exc
|
| 4 |
|
| 5 |
from pyrogram.errors import RPCError
|
| 6 |
+
from pyrogram.types import CallbackQuery, Message
|
| 7 |
|
| 8 |
from Powers import HELP_COMMANDS, LOGGER, SUPPORT_GROUP
|
| 9 |
from Powers.bot_class import Gojo
|
|
|
|
| 68 |
"https://t.me/psy_Logos",
|
| 69 |
"url",
|
| 70 |
),
|
| 71 |
+
(
|
| 72 |
+
"Powered by",
|
| 73 |
+
"https://gojo_bots_network.t.me",
|
| 74 |
+
"url",
|
| 75 |
+
),
|
| 76 |
],
|
| 77 |
],
|
| 78 |
)
|
|
|
|
| 260 |
"""
|
| 261 |
ou = await gen_cmds_kb(m)
|
| 262 |
help_kb = ikb(ou, True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
|
| 264 |
return help_msg, help_kb
|
README.md
CHANGED
|
@@ -39,7 +39,6 @@ Not a particular inspiration, inspired by many bots
|
|
| 39 |
Mainly:
|
| 40 |
|
| 41 |
* [Alita_Robot](https://github.com/divideprojects/Alita_Robot)
|
| 42 |
-
* [WilliamButcherBot](https://github.com/TheHamkerCat/WilliamButcherBot)
|
| 43 |
|
| 44 |
|
| 45 |
---------
|
|
@@ -259,8 +258,6 @@ To add your very own plugin just use the format given below and go through the [
|
|
| 259 |
|
| 260 |
* [PSYREX](https://github.com/iamPSYREX) `for logos`
|
| 261 |
|
| 262 |
-
* [PyKeyboard](https://github.com/pystorage/pykeyboard) `for pagination`
|
| 263 |
-
|
| 264 |
* [Pyrogram](https://github.com/pyrogram/pyrogram) `library`
|
| 265 |
|
| 266 |
---------
|
|
|
|
| 39 |
Mainly:
|
| 40 |
|
| 41 |
* [Alita_Robot](https://github.com/divideprojects/Alita_Robot)
|
|
|
|
| 42 |
|
| 43 |
|
| 44 |
---------
|
|
|
|
| 258 |
|
| 259 |
* [PSYREX](https://github.com/iamPSYREX) `for logos`
|
| 260 |
|
|
|
|
|
|
|
| 261 |
* [Pyrogram](https://github.com/pyrogram/pyrogram) `library`
|
| 262 |
|
| 263 |
---------
|
requirements.txt
CHANGED
|
@@ -17,7 +17,6 @@ idna==3.3; python_version >= "3.6" and (python_version >= "3.5" and python_full_
|
|
| 17 |
lxml==4.9.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
| 18 |
prettyconf==2.2.1
|
| 19 |
pyaes==1.6.1; python_version >= "3.6" and python_version < "4.0"
|
| 20 |
-
pykeyboard==0.1.5
|
| 21 |
pymongo==4.3.2
|
| 22 |
pyrogram==2.0.59; python_version >= "3.8"
|
| 23 |
pysocks==1.7.1; python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4.0" or python_version >= "3.7" and python_version < "4.0" and python_full_version >= "3.4.0"
|
|
|
|
| 17 |
lxml==4.9.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
|
| 18 |
prettyconf==2.2.1
|
| 19 |
pyaes==1.6.1; python_version >= "3.6" and python_version < "4.0"
|
|
|
|
| 20 |
pymongo==4.3.2
|
| 21 |
pyrogram==2.0.59; python_version >= "3.8"
|
| 22 |
pysocks==1.7.1; python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4.0" or python_version >= "3.7" and python_version < "4.0" and python_full_version >= "3.4.0"
|