WoW:API JoinChannelByName: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Move page script moved page API JoinChannelByName to API JoinChannelByName without leaving a redirect)
 
(10 intermediate revisions by 10 users not shown)
Line 1: Line 1:
<center>'''JoinChannelByName''' - ''Documentation by AlexanderYoshi''</center>
{{wowapi}}
Joins the channel with the specified name. A player can be in a maximum of 10 chat channels.


Joins the channel with the specified name.
type, name = JoinChannelByName("channelName" [,"password" [,frameID[, hasVoice]]])
 
retCode = JoinChannelByName("channelName" [,"password" [,frameID]])
== Parameters ==
== Parameters ==
=== Arguments ===
=== Arguments ===
:("channelName" [,"password" [,frameID]])
:;channelName : String - The name of the channel to join
:;channelName : String - The name of the channel to join
:;password : String <small><i>(optional)</i></small> - The channel password, nil if none.
:;: You can't use the "-" character in channelName (patch 1.9)
:;frameID : Number <small><i>(optional)</i></small> - The chat frame ID number to add the channel to. Use [[API Frame GetID|Frame:GetID()]] to retrieve it for chat frame objects.
:;password : String <small>''(optional)''</small> - The channel password, nil if none.
:;frameID : Number <small>''(optional)''</small> - The chat frame ID number to add the channel to. Use [[API Frame GetID|Frame:GetID()]] to retrieve it for chat frame objects.
:;hasVoice : Boolean (1/nil) - Enable voice chat for this channel.


=== Returns ===
=== Returns ===
:retCode
:;type : Number - The type of channel. 0 for a undefined channel, 1 for the zone General channel,  etc
:;name : String - The name of the channel (Ohklus: seems to be nil for most channels).


:;retCode : Number - Appears to always equal 0.
== Example ==
== Example ==
<!-- begin code -->
<!-- begin code -->
  JoinChannelByName("Mammoth", "thesane", ChatFrame1:GetID());
  local channel_type, channel_name = JoinChannelByName("Mammoth", "thesane", ChatFrame1:GetID(), 1);
<!-- end code -->
<!-- end code -->
== Details ==
: Joins the channel with the specified name if there are less than 10 live channels.
----
__NOTOC__
{{Template:WoW API}}
[[Category:API Chat Functions|JoinChannelByName]]

Latest revision as of 04:46, 15 August 2023

WoW API < JoinChannelByName

Joins the channel with the specified name. A player can be in a maximum of 10 chat channels.

type, name = JoinChannelByName("channelName" [,"password" [,frameID[, hasVoice]]])

Parameters[edit]

Arguments[edit]

channelName
String - The name of the channel to join
You can't use the "-" character in channelName (patch 1.9)
password
String (optional) - The channel password, nil if none.
frameID
Number (optional) - The chat frame ID number to add the channel to. Use Frame:GetID() to retrieve it for chat frame objects.
hasVoice
Boolean (1/nil) - Enable voice chat for this channel.

Returns[edit]

type
Number - The type of channel. 0 for a undefined channel, 1 for the zone General channel, etc
name
String - The name of the channel (Ohklus: seems to be nil for most channels).

Example[edit]

local channel_type, channel_name = JoinChannelByName("Mammoth", "thesane", ChatFrame1:GetID(), 1);