From e5f98fe24c244671607babe16761293a8698c97c Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Wed, 18 Feb 2026 00:40:26 -0600 Subject: [PATCH] Check rights for users before ignoring --- KfChatDotNetBot/Commands/AdminCommands.cs | 8 ++++++++ 1 file changed, 8 insertions(+) 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);