Skip to content

Instantly share code, notes, and snippets.

@X-Gorn
Created July 13, 2024 08:57
Show Gist options
  • Save X-Gorn/e112036f42a58af34b82fbfbc8e5e688 to your computer and use it in GitHub Desktop.
Save X-Gorn/e112036f42a58af34b82fbfbc8e5e688 to your computer and use it in GitHub Desktop.
Get All Channel of a User.
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