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
|
end
|
||||||
|
|
||||||
function core:GetChannelInfo(id)
|
function core:GetChannelInfo(id)
|
||||||
--addon.lua:373
|
local channelNumber,channelName = GetChannelName(id);
|
||||||
--channelapi.lua:65
|
local channelTable = core:GetChannelTable();
|
||||||
--channelapi.lua:55
|
|
||||||
local channelTable = core:GetChanneltable();
|
if(channelName == nil) then
|
||||||
|
channelName = channelTable[channelName];
|
||||||
|
end
|
||||||
|
|
||||||
|
return channelNumber,channelName,core:GetChannelCategory(channelNumber);
|
||||||
end
|
end
|
||||||
|
|
||||||
function core:GetChannelTable()
|
function core:GetChannelTable()
|
||||||
|
@ -94,6 +98,16 @@ function core:GetChannelTable()
|
||||||
return channelTable;
|
return channelTable;
|
||||||
end
|
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)
|
function core:JoinChannel(msg)
|
||||||
self.hooks[SlashCmdList].JOIN(msg);
|
self.hooks[SlashCmdList].JOIN(msg);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue