mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-21 21:48:05 +00:00
23 lines
506 B
Python
23 lines
506 B
Python
import json
|
|
|
|
from pyrogram.enums import ChatType
|
|
|
|
from pagermaid.services import bot
|
|
from pagermaid.utils import Sub
|
|
|
|
ignore_groups_manager = Sub("ignore_groups")
|
|
|
|
|
|
async def get_group_list():
|
|
try:
|
|
return [
|
|
json.loads(str(dialog.chat))
|
|
for dialog in await bot.get_dialogs_list()
|
|
if (
|
|
dialog.chat
|
|
and dialog.chat.type in [ChatType.SUPERGROUP, ChatType.GROUP]
|
|
)
|
|
]
|
|
except BaseException:
|
|
return []
|