有人可以帮助我吗?我是 dSharp 的新手,如何在我的服务器上发出禁止某人的命令?
[Command("ban")]
[Description("Bans a user")]
[RequireRoles(RoleCheckMode.Any, "Owner", "Supporter")]
public async Task Ban(CommandContext ctx, string reason)
{
}
获取 Discord 成员并调用 BanAsync
例子
[Command]
[RequireUserPermission(Permissions.Administator)]
[RequireBotPermission(Permissions.BanMembers)]
public async Task ban(CommandContext ctx, DiscordMember member, [RemaningText] string reason)
{
await member.BanAsync(1, reason);
}