Fandom

WoWWiki

API SetActiveVoiceChannelBySessionID

104,757pages on
this wiki
Add New Page
Talk0 Share
WoW API < SetActiveVoiceChannelBySessionID

Set the active voice channel by providing an ID.

successful = SetActiveVoiceChannelBySessionID(id)

Arguments Edit

id 
Number - Channel id.

Returns Edit

success
Boolean - returns true/1 if channel was changed successfully.

Triggers Events Edit

Example Edit

local success = SetActiveVoiceChannelBySessionID(2)

Result

success = 1

Details Edit

Note: This function cannot place you in the channels under the 'World' category (e.g. Trade, LookingForGroup).
Id is assigned when the client joins a channel, not by the order of the channels in the Voice Chat window. This means generic channels such as 'Party' and 'Battleground' will not have a static id if you join any number of custom channels before joining a party or battleground. If you wish to find the id of a channel use the GetNumVoiceSessions and GetVoiceSessionInfo functions as shown below.
function GetChannelIDByName(name)
   for id=1, GetNumVoiceSessions() do
      if name == GetVoiceSessionInfo(id) then
         return id
      end
   end
end

If you don't need to keep a reference of the id and simply wish to set a channel as active by name.

function SetChannelIDByName(name)
   for id=1, GetNumVoiceSessions() do
      if name == GetVoiceSessionInfo(id) then
         SetActiveVoiceChannelBySessionID(id)
         break
      end
   end
end

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.