Implement message throttling for whispers

This commit is contained in:
2024-10-16 17:14:35 +02:00
parent 6f811451ad
commit 9d2d289135
2 changed files with 7 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -212,7 +212,7 @@ for i, part in ipairs(stinkies) do
end
end
local killSpamTime = 30
local killSpamTime = 10
local recentlyKilled = {}
aura_env.RegisterKill = function(source, destination, spellName, overkill)
if recentlyKilled[source] and recentlyKilled[source] > GetTime() - killSpamTime then
@@ -238,14 +238,18 @@ aura_env.localStinkies = {}
---@param name string
aura_env.StinkyDetected = function(name)
if aura_env.config.debug then print(string.format("StinkyDetected (%s)", name)) end
local stinky = aura_env.stinkies[name]
if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
GetTime() - aura_env.config.messageThrottle then
local stinky = aura_env.stinkies[name]
Message.QueueNotifyGuild(stinky)
Message.QueueNotifyWhisper(stinky)
end
if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
GetTime() - aura_env.config.messageThrottleAddon then
Message.QueueNotifyAddonGuild(stinky)
Message.QueueNotifyAddonWhisper(stinky)
end
WeakAuras.ScanEvents("CHAT_MSG_ADDON", aura_env.addonprefix, stinky:FormAddonMessage())
aura_env.localStinkies[name] = GetTime()
end