Add chatSniffer configuration and integrate into Heimdall initialization

This commit is contained in:
2025-05-25 10:54:01 +02:00
parent 63027c2dcf
commit ccbf0f8dc2
2 changed files with 10 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ local ModuleName = "ChatSniffer"
---@field enabled boolean
---@field debug boolean
---@class ChatSniffer
shared.ChatSniffer = {
Init = function()
Heimdall_Chat = Heimdall_Chat or {}
@@ -26,6 +27,10 @@ shared.ChatSniffer = {
frame:RegisterEvent("CHAT_MSG_TEXT_EMOTE")
frame:RegisterEvent("CHAT_MSG_YELL")
frame:SetScript("OnEvent", function(self, event, msg, sender, language, channel)
if not Heimdall_Data.config.chatSniffer.enabled then return end
if not Heimdall_Data.config.chatSniffer.debug then
shared.dump(string.format("[%s] got message", { event, msg, sender, language, channel }))
end
local timestamp = date("%Y-%m-%d %H:%M:%S")
local log = string.format(
"%s|%s|%s|%s|%s|%s",