示例#1
0
        public async Task Ban(
            [Summary("The user to be banned.")]
            SocketUser user,
            [Summary("The number of days of messages to be deleted.\n(Default: 1)")]
            int prune = 1,
            [Remainder]
            [Summary("The reason for the ban.\n(Default: \"No Reason Provided.\")")]
            string reason = "No Reason Provided.")
        {
            try
            {
                await _moderation.Ban(Context.Guild, user, Context.User, prune, reason);

                var builders = await _log.CreateLog(user, Context.User, reason, Infraction.Ban);

                var channel = Context.Guild.GetChannel(Config.Log) as IMessageChannel;

                await channel.SendMessageAsync(embed : Embeds.CreateEmbed("Log", builders));

                await Context.Message.AddReactionAsync(new Emoji("✅"));
            }
            catch (Exception e)
            {
                await ReplyAsync(e.Message);
            }
        }