【发布时间】:2019-08-07 19:55:51
【问题描述】:
我有一些代码旨在让人们不和谐
namespace bot.Core.Commands
{
public class Kick : ModuleBase<SocketCommandContext>
{
[Command("kick"), Summary("")]
public async Task kick(IGuildUser User, string reason = "no reason")
{
User.KickAsync(reason);
}
}
}
int argpos = 0;
if (!(Message.HasStringPrefix("$", ref argpos) || Message.HasMentionPrefix(Client.CurrentUser, ref argpos))) return;
var result = await Commandss.ExecuteAsync(context, argpos);
if(!result.IsSuccess)
{
await context.Channel.SendMessageAsync("Command not found or has failed, Commands can also only be ran by an administrator");
}
但是它总是抛出 Command not found 或失败,Commands 也只能由管理员运行。任何人都可以解释为什么? 除了这个之外,所有其他命令都可以正常工作。提前致谢
我在 c# vs 2017 上使用 windows
也不是权限
【问题讨论】:
-
你在用
Discord.Net吗? -
是的,我是和 vs 2017