I am making a bot that creates channels. He must create channels in a certain category. I am using guild.create_text_channel(). I haven't found a way to do this in the documentation. Any help would be welcome.
I am making a bot that creates channels. He must create channels in a certain category. I am using guild.create_text_channel(). I haven't found a way to do this in the documentation. Any help would be welcome.
You can use discord.utils.get for getting a category by it's id. Here is a usage of it:
guild = discord.utils.get(client.guild.categories, id='put the id here without apostrophes')
You can do it with this.
from discord.utils import get
category = get(guild.category_channels, name="CATEGORY_NAME")
await guild.create_text_channel("CHANNEL_NAME", category=category)