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)
|
JoinPermanentChannel(channel)
|
||||||
end
|
end
|
||||||
channelId = GetChannelId(channel)
|
channelId = GetChannelId(channel)
|
||||||
|
aura_env.channelId = channelId
|
||||||
print(string.format("channel %s resolved to id %d", channel, channelId))
|
print(string.format("channel %s resolved to id %d", channel, channelId))
|
||||||
|
|
||||||
---@param msg string
|
---@param msg string
|
||||||
@@ -327,8 +328,4 @@ aura_env.NotifyChannelGone = function(player)
|
|||||||
local msg = string.format("%s of class %s and guild %s left %s", player.name, player.class, player.guild,
|
local msg = string.format("%s of class %s and guild %s left %s", player.name, player.class, player.guild,
|
||||||
player.zone)
|
player.zone)
|
||||||
NotifyChannel(msg)
|
NotifyChannel(msg)
|
||||||
end
|
end
|
||||||
|
|
||||||
local foo = Player.new("foo", "bar", "Human", "Warrior", "Orgrimmar")
|
|
||||||
aura_env.NotifyChannel(foo)
|
|
||||||
|
|
Reference in New Issue
Block a user