Returns information about a character in a chat channel in the channel list display


See also Channel functions.

Signature:

name, owner, moderator, muted, active, enabled = GetChannelRosterInfo(index, rosterIndex)

Arguments:

  • index - Index of a channel in the channel list display (between 1 and GetNumDisplayChannels()) (number)
  • rosterIndex - Index of a participant in the channel (between 1 and count, where count = select(5,GetChannelDisplayInfo(index)) (number)

Returns:

  • name - Name of the character (string)
  • owner - 1 if the character is the channel owner; otherwise nil (1nil)
  • moderator - 1 if the character is a channel moderator; otherwise nil (1nil)
  • muted - 1 if the character is muted; otherwise nil (1nil)
  • active - 1 if the character is currently speaking in the channel; otherwise nil (1nil)
  • enabled - 1 if the character has voice chat active for the channel; otherwise nil (1nil)

Examples:

-- Counts the number of players in the given channel who do not have
-- voice chat enabled, and prints it to chat.

-- This script should be run with the "Chat" window open and a channel selected
local index = GetSelectedDisplayChannel()
local count = select(5, GetChannelDisplayInfo(index))
local activeCount = 0
for i=1,count do
  local active = select(6, GetChannelRosterInfo(index, i))
  if active then
    activeCount = activeCount + 1
  end
end

print(activeCount .. " of " .. count .. " users have voice chat enabled in this channel.")