Implement replying to "who" on channel
This commit is contained in:
22
FreshShit/WhoSniffer/event6.lua
Normal file
22
FreshShit/WhoSniffer/event6.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
-- CHAT_MSG_CHANNEL
|
||||
---@type event string
|
||||
---@type msg string
|
||||
---@type sender string
|
||||
function(event, msg, sender, ...)
|
||||
local channelId = select(6, ...)
|
||||
if channelId ~= aura_env.channelId then
|
||||
return
|
||||
end
|
||||
|
||||
if msg == "who" then
|
||||
for _, player in pairs(aura_env.stinkies) do
|
||||
local msg = aura_env.MakeNotifyMessage(player)
|
||||
local message = {
|
||||
channel = "CHANNEL",
|
||||
data = channelId,
|
||||
message = msg
|
||||
}
|
||||
table.insert(aura_env.messageQueue, message)
|
||||
end
|
||||
end
|
||||
end
|
@@ -299,6 +299,7 @@ if not channelId then
|
||||
JoinPermanentChannel(channel)
|
||||
end
|
||||
channelId = GetChannelId(channel)
|
||||
aura_env.channelId = channelId
|
||||
print(string.format("channel %s resolved to id %d", channel, channelId))
|
||||
|
||||
---@param msg string
|
||||
@@ -328,7 +329,3 @@ aura_env.NotifyChannelGone = function(player)
|
||||
player.zone)
|
||||
NotifyChannel(msg)
|
||||
end
|
||||
|
||||
local foo = Player.new("foo", "bar", "Human", "Warrior", "Orgrimmar")
|
||||
aura_env.NotifyChannel(foo)
|
||||
|
||||
|
Reference in New Issue
Block a user