Answers for "discord.py bot.get user"

7

discord py get user by id

user = bot.get_user(user_id)
Posted by: Guest on May-21-2020
-1

discord api python putting ids in a list

@client.event
async def on_ready():
    guilds = client.guilds
    data = {}
    for guild in guilds:
        data[guild.id] = []
        for channel in guild.channels:
            data[guild.id].append(channel.id)
    with open("./data/guilds.json", "w") as file:
        json.dump(data, file, indent=4)
Posted by: Guest on January-18-2021

Python Answers by Framework

Browse Popular Code Answers by Language