Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Set the active voice channel.
success = SetActiveVoiceChannelBySessionID(id)
Arguments[]
- id
- Number - Channel ID.
Returns[]
- success
- boolean - Whether the channel changed to to the given ID.
Details[]
- Triggers VOICE_SESSIONS_UPDATE if the active channel switches.
- This function is not applicable to "World" channels such as Trade and LookingForGroup.
- IDs are not constant; they are assigned as the client joins each channel so they will change for users who have joined a variable number of channels. Refer to GetNumVoiceSessions() and GetVoiceSessionInfo().
Example[]
Simple usage:
local success = SetActiveVoiceChannelBySessionID(2)
print(success) -- true
Finding a channel's ID and then joining it:
function SetChannelIDByName(name)
for id=1, GetNumVoiceSessions() do
if name == GetVoiceSessionInfo(id) then
return SetActiveVoiceChannelBySessionID(id)
end
end
end