Add chatSniffer configuration and integrate into Heimdall initialization
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user