WoW:API GetChannelName: Difference between revisions
Jump to navigation
Jump to search
GetChannelName -Documentation by wowpendium.de-
No edit summary |
mNo edit summary |
||
Line 7: | Line 7: | ||
---- | ---- | ||
;''Arguments'' | ;''Arguments'' | ||
:;id : The id of the channel you want to query, | :;id : The numeric id of the channel you want to query, or a string containing the name of the channel. | ||
---- | ---- | ||
Line 15: | Line 14: | ||
:;id : a number containing the id of the channel, e.g. 2, or 0 if the channel is not found | :;id : a number containing the id of the channel, e.g. 2, or 0 if the channel is not found | ||
:;name : a string containing the name of the channel, e.g. "Trade - Stormwind", or nil if the channel is not found. | :;name : a string containing the name of the channel, e.g. "Trade - Stormwind", or nil if the channel is not found or the id parameter was a name. | ||
---- | ---- | ||
;''Important'' | ;''Important'' | ||
If the channel argument is the channel name (ie "testchan1"), then the returned channel name is a nil value. | If the channel argument is the channel name (ie "testchan1"), then the returned channel name is a nil value. | ||
If the channel argument is the channel number (ie 6 or "6"), then the returned channel name is correct. | If the channel argument is the channel number (ie 6 or "6"), then the returned channel name is correct. | ||
The channel id returns correctly in both cases. | The channel id returns correctly in both cases. | ||
---- | ---- |
Revision as of 21:11, 12 April 2006
Retrieves the id and the name from a specific channel.
id, name = GetChannelName(id);
- Arguments
- id
- The numeric id of the channel you want to query, or a string containing the name of the channel.
- Returns
- id
- a number containing the id of the channel, e.g. 2, or 0 if the channel is not found
- name
- a string containing the name of the channel, e.g. "Trade - Stormwind", or nil if the channel is not found or the id parameter was a name.
- Important
If the channel argument is the channel name (ie "testchan1"), then the returned channel name is a nil value. If the channel argument is the channel number (ie 6 or "6"), then the returned channel name is correct. The channel id returns correctly in both cases.
- Example
-- Check if the specific channel exists myChannel = 1; id, name = GetChannelName(myChannel); if (not id == 0 and name ~= nil) then SendChatMessage("This is just a test.", "CHANNEL", nil, myChannel); end
- Result
Checks if the channel with id stored in myChannel exists and in this case sends the text "This is just a test" to it.
- Description
- Retrieves the name from a specific channel.