Add some extra info when a user doesn't have access to command

This commit is contained in:
barelyprofessional
2024-07-26 11:28:33 +10:00
parent 8676241fbf
commit 632638fcb1
+3 -2
View File
@@ -1,4 +1,5 @@
using KfChatDotNetKickBot.Commands; using Humanizer;
using KfChatDotNetKickBot.Commands;
using KfChatDotNetWsClient.Models.Events; using KfChatDotNetWsClient.Models.Events;
using NLog; using NLog;
@@ -58,7 +59,7 @@ internal class BotCommands
if (user == null) return; if (user == null) 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.", 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);
break; break;
} }
var task = Task.Run(() => command.RunCommand(_bot, message, match.Groups, _cancellationToken), _cancellationToken); var task = Task.Run(() => command.RunCommand(_bot, message, match.Groups, _cancellationToken), _cancellationToken);