在特定类别discord.js中创建频道
如何在特定类别中创建频道? 我尝试了一下:
reaction.message.guild.channels.create(`ticket-${user.name}`).setParent(config.ticket_categorie)
但是它在没有任何类别的情况下在顶部创建了频道。
How can I create a channel in specific category?
I tried this:
reaction.message.guild.channels.create(`ticket-${user.name}`).setParent(config.ticket_categorie)
But it created the channel at the top without any category.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以创建一个频道,然后将其分配给
x
类别:You can create a channel, and then assign it to
x
category like this:我想,如果您在创建和使用的setparent中使用一个。在返回创建函数(即通道)的返回中,则将应用类别。这个问题提到了这一点,以及一种将其与第12版LIB一起使用的方法。另外,您应该在setParent上使用类别ID,似乎您正在使用类别的名称,这可能是问题所在。
添加频道
,根据此其他链接,您可以使用<< strong> parent 选项作为第二个参数传递到创建函数的第二个参数,以提供通道所属的类别ID:使用parent选项与创建
I guess that if you use a .then in create and used setParent on the return of the create function (which is the channel) the category would be applied. This question mentions this, as well as a way of using it with the 12th version of the lib. Also you should use the category id at setParent, it seems you're using the name of the category, which could be the problem.
add channel to category
And according to this other link, you could use the parent option passed as the second parameter to the create function to provide a category id that the channel belongs: Use parent option with create