0

Why is the 'members' list always empty when I try to append Telegram channels to it in the given code?

async def main():
    async with app:
        async for dialog in app.get_dialogs():
            # print(dialog.chat.title or dialog.chat.first_name)
            # print(dialog.chat.id)
            # print(dialog.chat.type)
            if dialog.chat.type == "channel":
                channel = dialog.chat.type
                members = []
                async for member in app.get_chat_members(channel.id):
                    members.append(member)

Why is the 'members' list always empty when I try to append Telegram channels to it, even though I can see channels with the 'channel' type printed when I use 'print(dialog.chat.type)'?

0 Answers0