Forgot to add a check for ignored user

This commit is contained in:
barelyprofessional
2024-08-15 11:58:10 +08:00
parent 59ec8f8850
commit 18a50a757d

View File

@@ -57,6 +57,7 @@ internal class BotCommands
var user = db.Users.FirstOrDefault(u => u.KfId == message.Author.Id); var user = db.Users.FirstOrDefault(u => u.KfId == message.Author.Id);
// This should never happen as brand-new users are created upon join // This should never happen as brand-new users are created upon join
if (user == null) return; if (user == null) return;
if (user.Ignored) return;
if (user.UserRight < command.RequiredRight) if (user.UserRight < command.RequiredRight)
{ {
_bot.SendChatMessage($"@{message.Author.Username}, you do not have access to use this command. Your rank: {user.UserRight.Humanize()}; Required rank: {command.RequiredRight.Humanize()}", true); _bot.SendChatMessage($"@{message.Author.Username}, you do not have access to use this command. Your rank: {user.UserRight.Humanize()}; Required rank: {command.RequiredRight.Humanize()}", true);