LUA Coders: How to get people in a chat channel

avatar
1 year, 1 month ago

Hi fellow coders out there

What I am trying to do: If I do "/join MyOwnChannel" I can then do "/chatlist MyOwnChannel" and get a list of people who have joined this channel.

Now, if I want to find out in an addon which people are in that channel it seems I can do

  ListChannelByName("MyOwnChannel")

which will result in an CHAT_MSG_CHANNEL_LIST event with the following data

 arg9: "MyOwnChannel"
 arg4: "6. MyOwnChannel"
 arg1: "*Urbin, Joe, Jack, Jim, Tom"

which is basically what I am looking for. Unfortunately, this also prints the following line to the chat

 [6. MyOwnChannel] [*Urbin, Joe, Jack, Jim, Tom] (same output that /chatlist MyOwnChannel produces)

Of course, I'd rather not spam the chat with this message everytime I parse the people in the channel. Is there a way to either get this information in a different way (preferred) or a way to turn off the line going to the chat temporarily (acceptable as a work-around).

Thanks for your help Cheers Urbin

avatar
1 year, 1 month ago

there's a way to hide its output message and also tell it to print the same message to you in a whisper, If you haven't figured it out by this weekend i'll take a look at it for you

avatar
1 year, 1 month ago

Hi Casuality

I haven't found out how to do what you suggest but I have found another solution:

Before querying the channel list:

 GLDG_Main:RegisterEvent("CHAT_MSG_CHANNEL_LIST")
 DEFAULT_CHAT_FRAME:UnregisterEvent("CHAT_MSG_CHANNEL_LIST")
 ListChannelByName(GLDG_ChannelName)

and then in OnEvent()

 if (event == "CHAT_MSG_CHANNEL_LIST") then
   DEFAULT_CHAT_FRAME:RegisterEvent("CHAT_MSG_CHANNEL_LIST")
   GLDG_Main:UnregisterEvent("CHAT_MSG_CHANNEL_LIST")
   GLDG_TreatList()
 end

Thanks for your input, anyway.

Cheers Urbin

avatar
1 year, 1 month ago

I think that's exactly what he meant - hide the output and show it again once you get the info you want.

If you didn't show it again then you wouldn't see the output of any /chatinfo commands for the rest of the session... d-oh!

avatar
1 year, 1 month ago

yeah basically

Quick Reply

You need to login or register to post comments.

Benefits of Registration

  • Interact with hundreds of thousands of other gamers on an open social network.
  • Post your stories, news, images, videos, and other content to share.
  • Create a network with your fellow gamers or join an existing one.
  • Gain reputation for everything you do.