Answer the question
In order to leave comments, you need to log in
How to get the CATEGORY discord?
for some reason, my create_text_channel category indicates none and I need to somehow get the category, I did not find it in the documentation.
Piece of code:
ticket_channel = await payload.member.guild.create_text_channel('cool-channel')
Answer the question
In order to leave comments, you need to log in
Category is just another type of channel. You can get a category object just like any other channel:
await guild.create_text_channel("channel_name", category=guild.get_channel(732068815788336617))
# или
await guild.create_text_channel("channel_name", category=discord.utils.get(guild.channels, name="Category"))
# или
await guild.get_channel(732068815788336617).create_text_channel("channel_name")
# или
await discord.utils.get(guild.channels, name="Category").create_text_channel("channel_name")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question