From eb94f61badb9a3b32283a7ee9d68cb676a9080e9 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Tue, 25 Oct 2016 07:51:15 +0200 Subject: [PATCH] Fixed .b and .sb --- src/NadekoBot/Modules/Administration/Administration.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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;