WoW:API GetChannelList: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__


 
'''GetChannelList'''
<center>'''GetChannelList''' </center>


Retrieves joined channels.
Retrieves joined channels.


  id1, name1, id2, name2, ... = GetChannelList();
  id1, name1, isOwner1, id2, name2, isOwner2 ... = GetChannelList();


== Parameters ==
== Parameters ==
Line 14: Line 13:
=== Returns===
=== Returns===


:;id1, name1, ...: pairs of channel number and channel name.
:;id1, name1, isOwner1...
:: triplets of channel number, channel name, and channel ownership (?).


----
----
;''Note''


Does not appear to return all channels, only some.  I have no
<span style="color: #d4d4d4;"></span><span style="color: #dcdcaa;"></span>
idea why, or what criteria it uses.
__NOTOC__


----
<pre>
    GetJoinedChannels = function ()
        local channels = { }
        local chanList = { GetChannelList() }
        for i=1, #chanList, 3 do
            table.insert(channels, {
                id = chanList[i],
                name = chanList[i+1],
                owned = chanList[i+2], -- Is owned the 3rd parameter?
            })
        end
        return channels;
    end,
</pre>

Revision as of 09:05, 6 November 2019

WoW API < GetChannelList

GetChannelList

Retrieves joined channels.

id1, name1, isOwner1, id2, name2, isOwner2 ... = GetChannelList();

Parameters

Arguments

() - none

Returns

id1, name1, isOwner1...
triplets of channel number, channel name, and channel ownership (?).

    GetJoinedChannels = function ()
        local channels = { }
        local chanList = { GetChannelList() }
        for i=1, #chanList, 3 do
            table.insert(channels, {
                id = chanList[i],
                name = chanList[i+1],
                owned = chanList[i+2], -- Is owned the 3rd parameter?
            })
        end
        return channels;
    end,