#!/usr/bin/env python3 """Fetch pinned messages from Ivory Orchid channel to find the roster.""" import asyncio import json import os import aiohttp DISCORD_BOT_TOKEN = os.environ["DISCORD_BOT_TOKEN"] CHANNEL_ID = "1464316770889240730" async def main() -> None: """Fetch and print pinned messages from the Ivory Orchid channel.""" headers = { "Authorization": f"Bot {DISCORD_BOT_TOKEN}", "Content-Type": "application/json", } async with ( aiohttp.ClientSession() as session, session.get( f"https://discord.com/api/v10/channels/{CHANNEL_ID}/pins", headers=headers, ) as response, ): pins = await response.json() print(json.dumps(pins, indent=2)) if __name__ == "__main__": asyncio.run(main())