WoW:API GetChannelList: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
Retrieves joined channels.
Retrieves joined channels.


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


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


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


----
----
Line 21: Line 21:


<pre>
<pre>
    GetJoinedChannels = function ()
function GetJoinedChannels()
        local channels = { }
    local channels = { }
        local chanList = { GetChannelList() }
    local chanList = { GetChannelList() }
        for i=1, #chanList, 3 do
    for i=1, #chanList, 3 do
            table.insert(channels, {
        table.insert(channels, {
                id = chanList[i],
            id = chanList[i],
                name = chanList[i+1],
            name = chanList[i+1],
                owned = chanList[i+2], -- Is owned the 3rd parameter?
            isDisabled = chanList[i+2], -- Not sure what a state of "blocked" would be
            })
        })
        end
    end
        return channels;
    return channels
    end,
end
</pre>
</pre>

Revision as of 06:42, 7 November 2019

WoW API < GetChannelList

GetChannelList

Retrieves joined channels.

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

Parameters

Arguments

() - none

Returns

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