1@client.event
2async def on_ready():
3 guilds = client.guilds
4 data = {}
5 for guild in guilds:
6 data[guild.id] = []
7 for channel in guild.channels:
8 data[guild.id].append(channel.id)
9 with open("./data/guilds.json", "w") as file:
10 json.dump(data, file, indent=4)
11