Rework the log messages to not spam on channel message

This commit is contained in:
2025-01-08 17:49:22 +01:00
parent d182cc1418
commit 2e44a1ef31
5 changed files with 69 additions and 47 deletions

View File

@@ -9,29 +9,33 @@ function shared.Emoter.Init()
local frame = CreateFrame("Frame")
frame:RegisterEvent("CHAT_MSG_CHANNEL")
frame:SetScript("OnEvent", function(self, event, msg, sender, ...)
if Heimdall_Data.config.emoter.debug then
print(string.format("[%s] Channel message received from: %s", ModuleName, sender))
end
-- if Heimdall_Data.config.emoter.debug then
-- print(string.format("[%s] Channel message received from: %s", ModuleName, sender))
-- end
if not Heimdall_Data.config.emoter.enabled then
if Heimdall_Data.config.emoter.debug then
print(string.format("[%s] Module disabled, ignoring message", ModuleName))
end
-- if Heimdall_Data.config.emoter.debug then
-- print(string.format("[%s] Module disabled, ignoring message", ModuleName))
-- end
return
end
local channelId = select(6, ...)
local _, channelname = GetChannelName(channelId)
if Heimdall_Data.config.emoter.debug then
print(string.format("[%s] Processing message from channel: %s", ModuleName, channelname))
end
-- if Heimdall_Data.config.emoter.debug then
-- print(string.format("[%s] Processing message from channel: %s", ModuleName, channelname))
-- end
if channelname ~= Heimdall_Data.config.emoter.masterChannel then
if Heimdall_Data.config.emoter.debug then
print(string.format("[%s] Ignoring message from non-master channel", ModuleName))
end
-- if Heimdall_Data.config.emoter.debug then
-- print(string.format("[%s] Ignoring message from non-master channel", ModuleName))
-- end
return
end
if Heimdall_Data.config.emoter.debug then
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
shared.dumpTable(Heimdall_Data.config.emoter)
end
if string.find(msg, "^" .. Heimdall_Data.config.emoter.prefix) then
if Heimdall_Data.config.emoter.debug then