Spaces:
Paused
Paused
Captain Ezio
commited on
Commit
·
c437284
1
Parent(s):
5d8dc65
Update dev.py
Browse files- Powers/plugins/dev.py +19 -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, 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
|
|
@@ -17,7 +17,24 @@ from Powers.utils.custom_filters import command
|
|
| 17 |
from Powers.utils.http_helper import *
|
| 18 |
from Powers.utils.parser import mention_markdown
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
@Gojo.on_message(command("ping", sudo_cmd=True))
|
| 22 |
async def ping(_, m: Message):
|
| 23 |
LOGGER.info(f"{m.from_user.id} used ping cmd in {m.chat.id}")
|
|
|
|
| 9 |
PeerIdInvalid, RPCError)
|
| 10 |
from pyrogram.types import Message
|
| 11 |
|
| 12 |
+
from Powers import BOT_TOKEN, LOGFILE, LOGGER, MESSAGE_DUMP, UPTIME, OWNER_ID, defult_dev
|
| 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
|
|
|
|
| 17 |
from Powers.utils.http_helper import *
|
| 18 |
from Powers.utils.parser import mention_markdown
|
| 19 |
|
| 20 |
+
@Gojo.on_message(command("adddev"))
|
| 21 |
+
async def add_dev(c: Gojo, m:Message):
|
| 22 |
+
split = m.text.split(None)
|
| 23 |
+
reply_to = m.reply_to_message
|
| 24 |
+
if len(split) != 2 or not reply_to:
|
| 25 |
+
await m.reply_text("Give me an id or reply to message to add the user in dev")
|
| 26 |
+
return
|
| 27 |
+
if reply_to:
|
| 28 |
+
user = reply_to.from_user.id
|
| 29 |
+
elif len(split) == 2:
|
| 30 |
+
try:
|
| 31 |
+
user = split[1]
|
| 32 |
+
except ValueError:
|
| 33 |
+
await m.reply_text("Give me id of the user")
|
| 34 |
+
return
|
| 35 |
+
defult_dev.append(user)
|
| 36 |
+
return
|
| 37 |
+
|
| 38 |
@Gojo.on_message(command("ping", sudo_cmd=True))
|
| 39 |
async def ping(_, m: Message):
|
| 40 |
LOGGER.info(f"{m.from_user.id} used ping cmd in {m.chat.id}")
|