本文介绍了如何通过类别ID获取类别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在制作一个创建频道的机器人.他必须创建某个类别的渠道.我正在使用 guild.create_text_channel()
.我在文档中没有找到执行此操作的方法.任何帮助都将受到欢迎.
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.
推荐答案
您可以使用 discord.utils.get
通过其ID获取类别.这是它的用法:
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')
这篇关于如何通过类别ID获取类别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!