PagerMaid-Pyro/pagermaid/common/ignore.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
506 B
Python
Raw Normal View History

2023-01-31 16:24:56 +00:00
import json
from pyrogram.enums import ChatType
from pagermaid.services import bot
from pagermaid.utils import Sub
2023-01-31 16:24:56 +00:00
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 []