Exemple #1
0
        public async Task Mute(
            [Summary("The user to be muted.")]
            IUser user,
            [Summary("The length of the mute in minutes.\n(Default: 10)")]
            double period = 10,
            [Summary("The mute period span.\n(Default: Minutes)\n(Available: Seconds, Minutes, Hours, Days)")]
            Measure measure = Measure.Minutes,
            [Remainder]
            [Summary("The reason for the mute.\n(Default: \"No Reason Provided.\")")]
            string reason = "No Reason Provided.")
        {
            try
            {
                await _moderation.Mute(Context.Guild, user, Context.User, period, reason);

                await _moderation.StartTimer(Context.Guild, user, period, measure);

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

                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);
            }
        }