Created
July 13, 2024 08:57
-
-
Save X-Gorn/e112036f42a58af34b82fbfbc8e5e688 to your computer and use it in GitHub Desktop.
Get All Channel of a User.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyrogram import Client, enums | |
bot = Client() | |
async def get_channels(): | |
async for dialog in bot.get_dialogs(): | |
if dialog.chat.type == enums.ChatType.CHANNEL: | |
yield dialog | |
async for dialog in get_channels(): | |
print(dialog) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment