Skip to content

Commit

Permalink
fix(ML): RA logger spam
Browse files Browse the repository at this point in the history
  • Loading branch information
JayXTQ committed Dec 11, 2024
1 parent 8a3b884 commit 75531ca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions DiscordLab.ModerationLogs/Patches/RemoteAdminLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi

private static void SendCommand(string query, CommandSender sender)
{
if (Plugin.Instance.Config.RemoteAdminChannelId == 0) return;

string[] args = query.Trim().Split(QueryProcessor.SpaceArray, 512, StringSplitOptions.RemoveEmptyEntries);
if (args[0].StartsWith("$"))
return;

Player player = sender is PlayerCommandSender commandSender
? Player.Get(commandSender)
: Server.Host;
if (player == null || string.IsNullOrEmpty(player.UserId)) return;

if (Plugin.Instance.Config.RemoteAdminChannelId == 0) return;

SocketTextChannel channel = DiscordBot.Instance.GetRemoteAdminChannel();
if (channel == null)
{
Expand Down

0 comments on commit 75531ca

Please sign in to comment.