SendAddonMessage to Channel not working - WoWInterface
Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-21-21, 04:48 AM   #1
A Murloc Raider
Join Date: Oct 2009
Posts: 4
Question SendAddonMessage to Channel not working

As a followup to my previous post about sending messages around...

It seems that using SendAddonMessage with a custom channel doesn't work (or I'm doing something totally wrong).

If I send a message with SendAddonMessage to a party, it works fine, but if I do it to a (custom) channel, nothing get's received.

Sample project attached. What am I doing wrong? It looks right...

SLASH_ZSCT1 = "/zsct"

SlashCmdList["ZSCT"] = function(msg)
    print("Sent message through party ...")
    C_ChatInfo.SendAddonMessage(prefix, "sent using party")
    print("Sent message through channel (" .. channelid .. ") ...")
    C_ChatInfo.SendAddonMessage(prefix, "sent using channel", "CHANNEL", channelid)

local function zSendChatTest_EventHandler(self, event, pre, msg, distribution, sender)
    if pre == prefix then
        print("Received message " .. msg)

channelname = "zsendchattest"
prefix = "zsendchattest"
password = "secret"

JoinChannelByName(channelname, password)
channelid = GetChannelName(channelname)


zSendChatTest_Frame = CreateFrame("Frame")
zSendChatTest_Frame:SetScript("OnEvent",  zSendChatTest_EventHandler)

print("ZSCT Loaded")
Client 1 ("master")

Client 2 ("slave")
Attached Files
File Type: zip zSendChatTest.zip (1,000 Bytes, 41 views)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » SendAddonMessage to Channel not working

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off