WoW:API GetChannelList: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Added page)
 
m (Move page script moved page API GetChannelList to API GetChannelList without leaving a redirect)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<center>'''GetChannelList''' </center>
{{wowapi}} __NOTOC__
 
'''GetChannelList'''


Retrieves joined channels.
Retrieves joined channels.


  id1, name1, id2, name2, ... = GetChannelList();
  id1, name1, disabled1, id2, name2, disabled2, ... = GetChannelList();


----
== Parameters ==
;''Arguments''
=== Arguments ===
:() - none
:() - none
----
----
;''Returns''
=== Returns===


:;id1, name1, ...: pairs of channel number and channel name.
:;id1, name1, disabled, ...
:: triplets of channel number, channel name, and channel disabled. (see Blizzard_TradeSkillUI.lua TradeSkillUIMixin:InitLinkToMenu()).


----
----
;''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.
 
<pre>
function GetJoinedChannels()
    local channels = { }
    local chanList = { GetChannelList() }
    for i=1, #chanList, 3 do
        table.insert(channels, {
            id = chanList[i],
            name = chanList[i+1],
            isDisabled = chanList[i+2], -- Not sure what a state of "blocked" would be
        })
    end
    return channels
end
</pre>

Latest revision as of 04:45, 15 August 2023

WoW API < GetChannelList

GetChannelList

Retrieves joined channels.

id1, name1, disabled1, id2, name2, disabled2, ... = GetChannelList();

Parameters[edit]

Arguments[edit]

() - none

Returns[edit]

id1, name1, disabled, ...
triplets of channel number, channel name, and channel disabled. (see Blizzard_TradeSkillUI.lua TradeSkillUIMixin:InitLinkToMenu()).

function GetJoinedChannels()
    local channels = { }
    local chanList = { GetChannelList() }
    for i=1, #chanList, 3 do
        table.insert(channels, {
            id = chanList[i],
            name = chanList[i+1],
            isDisabled = chanList[i+2], -- Not sure what a state of "blocked" would be
        })
    end
    return channels
end