.warn can now only be used on users lower than you in the role hierarchy
This commit is contained in:
		| @@ -29,6 +29,11 @@ namespace NadekoBot.Modules.Administration | |||||||
|             [RequireUserPermission(GuildPermission.BanMembers)] |             [RequireUserPermission(GuildPermission.BanMembers)] | ||||||
|             public async Task Warn(IGuildUser user, [Remainder] string reason = null) |             public async Task Warn(IGuildUser user, [Remainder] string reason = null) | ||||||
|             { |             { | ||||||
|  |                 if (Context.User.Id != user.Guild.OwnerId && (user.GetRoles().Select(r => r.Position).Max() >= ((IGuildUser)Context.User).GetRoles().Select(r => r.Position).Max())) | ||||||
|  |                 { | ||||||
|  |                     await ReplyErrorLocalized("hierarchy").ConfigureAwait(false); | ||||||
|  |                     return; | ||||||
|  |                 } | ||||||
|                 try |                 try | ||||||
|                 { |                 { | ||||||
|                     await (await user.GetOrCreateDMChannelAsync()).EmbedAsync(new EmbedBuilder().WithErrorColor() |                     await (await user.GetOrCreateDMChannelAsync()).EmbedAsync(new EmbedBuilder().WithErrorColor() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user