.rar fixed, closes #1306

This commit is contained in:
Master Kwoth 2017-06-25 03:56:23 +02:00
parent 3f2eef5647
commit ff56af3e73

View File

@ -126,17 +126,17 @@ namespace NadekoBot.Modules.Administration
{ {
var guser = (IGuildUser)Context.User; var guser = (IGuildUser)Context.User;
var userRoles = user.GetRoles(); var userRoles = user.GetRoles().Except(new[] { guser.Guild.EveryoneRole });
if (guser.Id != Context.Guild.OwnerId && if (user.Id == Context.Guild.OwnerId || (Context.User.Id != Context.Guild.OwnerId && guser.GetRoles().Max(x => x.Position) <= userRoles.Max(x => x.Position)))
(user.Id == Context.Guild.OwnerId || guser.GetRoles().Max(x => x.Position) <= userRoles.Max(x => x.Position)))
return; return;
try try
{ {
await user.RemoveRolesAsync(userRoles).ConfigureAwait(false); await user.RemoveRolesAsync(userRoles).ConfigureAwait(false);
await ReplyConfirmLocalized("rar", Format.Bold(user.ToString())).ConfigureAwait(false); await ReplyConfirmLocalized("rar", Format.Bold(user.ToString())).ConfigureAwait(false);
} }
catch catch (Exception ex)
{ {
Console.WriteLine(ex);
await ReplyErrorLocalized("rar_err").ConfigureAwait(false); await ReplyErrorLocalized("rar_err").ConfigureAwait(false);
} }
} }