Ejemplo n.º 1
0
        public async Task MuteAsync(
            [Summary("Jimbo#5555")][NoSelf][NotMutedParam] IUser user,
            [Summary("8h")][MinimumHours(Config.MIN_MUTE_LENGTH)] TimeSpan length,
            [Summary("stop with all that ruckus!")][Remainder][MaximumLength(Config.MAX_REASON_LENGTH)] string reason = null)
        {
            var guildUser = await Context.Guild.GetUserAsync(user.Id);

            await guildUser?.AddRoleAsync(Context.Guild.GetRole(Context.DbGuild.MutedRoleId.Value));

            await Context.ReplyAsync($"You have successfully muted {user.Bold()}.");

            await _modService.CreateMute(Context, user, length, reason);
        }