diff --git a/src/NadekoBot/Modules/Administration/Administration.cs b/src/NadekoBot/Modules/Administration/Administration.cs index 28a68c1b..80abffda 100644 --- a/src/NadekoBot/Modules/Administration/Administration.cs +++ b/src/NadekoBot/Modules/Administration/Administration.cs @@ -306,11 +306,6 @@ namespace NadekoBot.Modules.Administration await channel.SendMessageAsync("You can't use this command on users with a role higher or equal to yours in the role hierarchy."); return; } - if (umsg.Author.Id != user.Guild.OwnerId && user.Roles.Max().Position >= ((IGuildUser)umsg.Author).Roles.Max().Position) - { - await channel.SendMessageAsync("You can't use this command on users with a role higher or equal to yours in the role hierarchy."); - return; - } try { await (await user.CreateDMChannelAsync()).SendMessageAsync($"**You have been BANNED from `{channel.Guild.Name}` server.**\n" + @@ -340,7 +335,7 @@ namespace NadekoBot.Modules.Administration { msg = "No reason provided."; } - if (umsg.Author.Id != user.Guild.OwnerId && user.Roles.Max().Position >= ((IGuildUser)umsg.Author).Roles.Max().Position) + if (umsg.Author.Id != user.Guild.OwnerId && user.Roles.Select(r => r.Position).Max() >= ((IGuildUser)umsg.Author).Roles.Select(r => r.Position).Max()) { await channel.SendMessageAsync("You can't use this command on users with a role higher or equal to yours in the role hierarchy."); return;