PagerMaid-Pyro/pagermaid/common/ignore.py
xtaodada a941308d17
Some checks failed
Docker Dev Build / docker build and publish (push) Failing after 13s
Docker Build / docker build and publish (push) Failing after 11s
🔖 Update to v1.5.0
这是一项破坏性变更,目录结构进行了重组,无核心功能变化
2024-09-28 22:01:40 +08:00

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 []