【发布时间】:2019-10-14 14:39:13
【问题描述】:
我是 Discord.Net API 的新手,并且非常熟悉它。但我在将机器人创建的频道移动到现有类别频道时遇到问题。如果我可以只使用频道 ID 就可以了,但理想情况下它会找到一个名为“用户报告”的类别并从中获取 ID 以设置频道父级或位置。
//This is what i have to create a channel for testing purposes
var test = await Context.Guild.CreateTextChannelAsync("HI");
//I used this previously to find if a message was sent in a specific channel then it would act
if (Context.Channel.Name != "report-user")
{
await Context.User.SendMessageAsync(Context.User + " You have tried to send a ticket to the wrong channel. Please use the report-user channel");
return;
}
【问题讨论】:
-
您可以在创建频道时使用
CreateTextChannelAsync方法的第二个参数指定频道类别
标签: c# discord discord.net