.warn can now only be used on users lower than you in the role hierarchy
This commit is contained in:
parent
f53c77ec9d
commit
2d81bc45fd
@ -29,6 +29,11 @@ namespace NadekoBot.Modules.Administration
|
||||
[RequireUserPermission(GuildPermission.BanMembers)]
|
||||
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
|
||||
{
|
||||
await (await user.GetOrCreateDMChannelAsync()).EmbedAsync(new EmbedBuilder().WithErrorColor()
|
||||
|
Loading…
Reference in New Issue
Block a user