diff --git a/KfChatDotNetBot/Commands/AdminCommands.cs b/KfChatDotNetBot/Commands/AdminCommands.cs index 2acd0a7..462cefa 100644 --- a/KfChatDotNetBot/Commands/AdminCommands.cs +++ b/KfChatDotNetBot/Commands/AdminCommands.cs @@ -1,6 +1,7 @@ using System.Runtime.Caching; using System.Text.RegularExpressions; using Humanizer; +using KfChatDotNetBot.Extensions; using KfChatDotNetBot.Models; using KfChatDotNetBot.Models.DbModels; using KfChatDotNetBot.Settings; @@ -374,6 +375,13 @@ public class IgnoreCommand : ICommand return; } + if (targetUser.UserRight > user.UserRight) + { + await botInstance.SendChatMessageAsync( + $"{user.FormatUsername()}, you can't ignore someone who is more powerful than you", true); + return; + } + targetUser.Ignored = true; await db.SaveChangesAsync(ctx); await botInstance.SendChatMessageAsync($"Now ignoring {targetUser.KfUsername}", true);