GetChannelInfo function to return number, name, and category of a channel: NOT TESTED
This commit is contained in:
parent
71036313e9
commit
2dcf64b159
1 changed files with 19 additions and 5 deletions
|
@ -74,10 +74,14 @@ function core:SetupChatSaver(...)
|
|||
end
|
||||
|
||||
function core:GetChannelInfo(id)
|
||||
--addon.lua:373
|
||||
--channelapi.lua:65
|
||||
--channelapi.lua:55
|
||||
local channelTable = core:GetChanneltable();
|
||||
local channelNumber,channelName = GetChannelName(id);
|
||||
local channelTable = core:GetChannelTable();
|
||||
|
||||
if(channelName == nil) then
|
||||
channelName = channelTable[channelName];
|
||||
end
|
||||
|
||||
return channelNumber,channelName,core:GetChannelCategory(channelNumber);
|
||||
end
|
||||
|
||||
function core:GetChannelTable()
|
||||
|
@ -90,10 +94,20 @@ function core:GetChannelTable()
|
|||
channelTable[channelList[i + 1]:lower()] = channelList[i];
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return channelTable;
|
||||
end
|
||||
|
||||
function core:GetChannelCategory(number)
|
||||
for i = 1,GetNumDisplayChannels(),i do
|
||||
_,_,channelNumber,_,_,category = GetChannelDisplayInfo(i);
|
||||
|
||||
if(channelNumber == number) then
|
||||
return category;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function core:JoinChannel(msg)
|
||||
self.hooks[SlashCmdList].JOIN(msg);
|
||||
|
||||
|
|
Loading…
Reference in a new issue