diff --git a/Channeler.lua b/Channeler.lua index 03af6cb..47073ec 100644 --- a/Channeler.lua +++ b/Channeler.lua @@ -8,7 +8,7 @@ local debug = false local channels = { { name = "Horde", password = "garrosh" }, { name = "world_ru", password = nil }, - { name = "Agent", password = "agents42" }, + { name = "Agent", password = "agents42" }, } ---@type string ---@type string[] @@ -107,11 +107,28 @@ local function FindOrCreateChatFrame(chatFrameName, groups, channels) return chatFrame end +local function Privjet(channelname) + local channels = { GetChannelList() } + for i = 1, #channels, 2 do + local id = channels[i] + local name = channels[i + 1] + if name == channelname then + SendChatMessage("Zdravstvuyte ljudi!", "CHANNEL", nil, id) + return + end + end +end + local function Configure() JoinChannels() - FindOrCreateChatFrame("Auto", subscribedMessageGroups, {}) + -- FindOrCreateChatFrame("Auto", subscribedMessageGroups, subscribedChannels) + -- FindOrCreateChatFrame("world_ru", {}, { "world_ru" }) FindOrCreateChatFrame("Horde", {}, { "Horde" }) FindOrCreateChatFrame("Agent", {}, { "Agent" }) + Privjet("Horde") + C_Timer.After(1, function() + Privjet("Agent") + end) end local frame = CreateFrame("Frame") diff --git a/Channeler.zip b/Channeler.zip index ab329aa..a403d2d 100644 --- a/Channeler.zip +++ b/Channeler.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2df6a855f842e4db9c28f1c2ce2e8c2ce77e1ada1d2ec2df51b2028b35419f73 -size 1627 +oid sha256:1298e286f2f547d8d3e7d4bf306862cb67557a1decfeabc910789a5090b655e3 +size 1757