Example #1
0
        public async Task Mute(IGuildUser user, [Remainder] string reason = null)
        {
            var mutedRole = await _moderationService.FetchMutedRole(Context.Guild);

            if (user.RoleIds.Contains(mutedRole.Id))
            {
                await Context.ReplyAsync("This user is already muted.");
            }
            else
            {
                await user.AddRoleAsync(mutedRole);

                await Context.ReplyAsync("You have successfully muted " + user.Tag() + ".");
            }
        }