0

有人可以帮助我吗?我是 dSharp 的新手,如何在我的服务器上发出禁止某人的命令?

 [Command("ban")]
    [Description("Bans a user")]
    [RequireRoles(RoleCheckMode.Any, "Owner", "Supporter")]
    public async Task Ban(CommandContext ctx, string reason)
    {
        
    }
4

1 回答 1

0

获取 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);
}
于 2021-02-26T17:52:26.113 回答