|
from pyrogram import Client, filters |
|
from pyrogram.types import Message |
|
from Devine import app |
|
|
|
@app.on_message(filters.command("groupinfo", prefixes="/")) |
|
async def get_group_status(_, message: Message): |
|
if len(message.command) != 2: |
|
await message.reply("ᴘʟᴇᴀsᴇ ᴘʀᴏᴠɪᴅᴇ ᴀ ɢʀᴏᴜᴘ ᴜsᴇʀɴᴀᴍᴇ. ᴇxᴀᴍᴘʟᴇ: `/groupinfo YourGroupUsername`") |
|
return |
|
|
|
group_username = message.command[1] |
|
|
|
try: |
|
group = await app.get_chat(group_username) |
|
except Exception as e: |
|
await message.reply(f"ᴇʀʀᴏʀ: {e}") |
|
return |
|
|
|
total_members = await app.get_chat_members_count(group.id) |
|
group_description = group.description |
|
premium_acc = banned = deleted_acc = bot = 0 |
|
|
|
|
|
response_text = ( |
|
f"➲ ɢʀᴏᴜᴘ ɴᴀᴍᴇ : {group.title}\n" |
|
f"➲ ɢʀᴏᴜᴘ ɪᴅ : <code>{group.id}</code>\n" |
|
f"➲ ᴛᴏᴛᴀʟ ᴍᴇᴍʙᴇʀs : {total_members}\n" |
|
f"➲ ᴅᴇsᴄʀɪᴘᴛɪᴏɴ : {group_description or 'N/A'}\n" |
|
f"➲ ᴜsᴇʀɴᴀᴍᴇ : {group_username}.t.me\n" |
|
) |
|
|
|
await message.reply(response_text) |
|
|
|
|
|
|
|
@app.on_message(filters.command("cstatus") & filters.group) |
|
def group_status(client, message): |
|
chat = message.chat |
|
status_text = ( |
|
f"ɢʀᴏᴜᴘ ɪᴅ: {chat.id}\n" |
|
f"ᴛɪᴛʟᴇ: <code>{chat.title}</code>\n" |
|
f"ᴛʏᴘᴇ: {chat.type}\n" |
|
) |
|
|
|
if chat.username: |
|
status_text += f"ᴜsᴇʀɴᴀᴍᴇ: {chat.username}.t.me" |
|
else: |
|
status_text += "ᴜsᴇʀɴᴀᴍᴇ: None" |
|
|
|
message.reply_text(status_text) |
|
|