AgentSkillsCN

wow-api-social-chat

WoW Retail聊天、社交、俱乐部/社区、好友列表、语音聊天、BattleNet、Ping、社交队列,以及插件消息API的完整参考。涵盖C_ChatInfo、C_Club、C_ClubFinder、C_FriendList、C_BattleNet、C_VoiceChat、C_SocialRestrictions、C_SocialQueue、C_RecentAllies、C_PingManager、C_TTSSettings、聊天框功能、聊天过滤器、插件消息系统,以及12.0.0版本中的实例限制(SendAddonMessage被屏蔽,聊天消息可能被设为秘密)。当您需要处理聊天输出、聊天频道、社区、好友列表、语音聊天、BattleNet好友、插件通信、社交功能,或Ping系统时,此功能将为您提供全面支持。

SKILL.md
--- frontmatter
name: wow-api-social-chat
description: "Complete reference for WoW Retail Chat, Social, Club/Community, Friend List, Voice Chat, BattleNet, Ping, Social Queue, and Addon Messaging APIs. Covers C_ChatInfo, C_Club, C_ClubFinder, C_FriendList, C_BattleNet, C_VoiceChat, C_SocialRestrictions, C_SocialQueue, C_RecentAllies, C_PingManager, C_TTSSettings, ChatFrame functions, chat filters, addon message system, and 12.0.0 instance restrictions (SendAddonMessage blocked, chat messages may be secret). Use when working with chat output, chat channels, communities, friend lists, voice chat, BattleNet friends, addon communication, social features, or ping system."

Social & Chat API (Retail — Patch 12.0.0)

Comprehensive reference for chat, social, clubs/communities, friends, voice, BattleNet, and related APIs.

Source: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API Current as of: Patch 12.0.0 (Build 65655) — January 28, 2026 Scope: Retail only.

CRITICAL: 12.0.0 Instance Restrictions

  • SendAddonMessage() is BLOCKED inside instances (dungeons, raids, BGs, arenas)
  • Chat messages in instances may be secret values (KStrings)
  • Addon communication must use alternative patterns outside instances
  • C_ChatInfo.SendAddonMessage() and C_ChatInfo.SendAddonMessageLogged() throw errors in instances

Scope

  • C_ChatInfo — Chat system, channels, addon messages
  • Chat Frame Functions — SendChatMessage, chat filters, chat bubbles
  • C_Club — Communities / clubs system
  • C_ClubFinder — Club finder / recruitment
  • C_FriendList — Friends list management
  • C_BattleNet — BattleNet friends, presence, game accounts
  • C_VoiceChat — Voice chat system
  • C_SocialRestrictions — Social restriction checks
  • C_SocialQueue — Social queue system
  • C_RecentAllies — Recent allies tracking
  • C_PingManager — In-world ping system
  • C_TTSSettings — Text-to-speech settings

C_ChatInfo — Chat System

Key Functions

FunctionReturnsDescription
C_ChatInfo.SendAddonMessage(prefix, message, chatType [, target])successSend addon message (BLOCKED in instances)
C_ChatInfo.SendAddonMessageLogged(prefix, message, chatType [, target])successSend logged addon message (BLOCKED in instances)
C_ChatInfo.RegisterAddonMessagePrefix(prefix)successRegister prefix for CHAT_MSG_ADDON
C_ChatInfo.IsAddonMessagePrefixRegistered(prefix)isRegisteredCheck if prefix registered
C_ChatInfo.GetRegisteredAddonMessagePrefixes()prefixesAll registered prefixes
C_ChatInfo.GetChannelInfoFromIdentifier(identifier)infoChannel info by identifier
C_ChatInfo.GetChannelRuleset(channelIndex)rulesetIDChannel ruleset
C_ChatInfo.GetChannelRulesetForChannelID(channelID)rulesetIDRuleset by channel ID
C_ChatInfo.GetChannelShortcut(channelIndex)shortcutChannel shortcut
C_ChatInfo.GetChannelShortcutForChannelID(channelID)shortcutShortcut by channel ID
C_ChatInfo.GetChatLineSenderGUID(lineID)guidGUID of message sender
C_ChatInfo.GetChatLineSenderName(lineID)nameName of message sender
C_ChatInfo.GetChatLineText(lineID)textMessage text
C_ChatInfo.GetChatTypeByID(chatTypeID)chatTypeChat type string from ID
C_ChatInfo.GetColorForChatType(chatType)r, g, bDefault color for chat type
C_ChatInfo.GetNumActiveChannels()numChannelsNumber of active channels
C_ChatInfo.GetActiveChannelList()channelsActive channel list
C_ChatInfo.IsChannelRegional(chatType)isRegionalIs channel regional?
C_ChatInfo.IsChatLineCensored(lineID)isCensoredIs message censored?
C_ChatInfo.IsPartyPositionCategory(category)isPartyPositionIs party position category?
C_ChatInfo.IsRegionalServiceAvailable()isAvailableRegional service available?
C_ChatInfo.IsValidChatLine(lineID)isValidIs line valid?
C_ChatInfo.ReplaceIconAndGroupExpressions(message)textExpand {rt1}, {skull}, etc.
C_ChatInfo.ResetDefaultZoneChannels()Reset zone channels
C_ChatInfo.SwapChatChannelsByChannelIndex(i1, i2)Swap channel order

Global Chat Functions

FunctionReturnsDescription
SendChatMessage(msg [, chatType [, languageID [, target]]])Send chat message
GetNumDisplayChannels()numChannelsNumber of displayed channels
GetChannelDisplayInfo(index)name, header, collapsed, channelNumber, count, active, category, voiceEnabled, voiceActiveChannel display info
GetChannelName(idOrName)id, name, instanceID, isCommChannelChannel name/ID lookup
JoinChannelByName(name [, password [, frameID]])type, nameJoin a channel
LeaveChannelByName(name)Leave a channel
ListChannelByName(name)List channel members
GetChatWindowInfo(frameIndex)name, fontSize, r, g, b, alpha, shown, locked, docked, uninteractableChat window info
SetChatWindowName(frameIndex, name)Set chat window name
LoggingChat(enable)Toggle chat logging
LoggingCombat(enable)Toggle combat logging

C_Club — Communities / Clubs

Club Management

FunctionReturnsDescription
C_Club.GetSubscribedClubs()clubsAll joined clubs
C_Club.GetClubInfo(clubId)infoClub info
C_Club.GetClubMembers(clubId [, streamId])membersClub member list
C_Club.GetMemberInfo(clubId, memberId)infoMember info
C_Club.GetClubStreamNotificationSettings(clubId)settingsStream notification settings
C_Club.CreateClub(name, shortName, description, clubType, avatarId)Create new club
C_Club.DestroyClub(clubId)Destroy a club
C_Club.EditClub(clubId, name, shortName, description, avatarId, bgColorIndex)Edit club
C_Club.LeaveClub(clubId)Leave a club
C_Club.AcceptInvitation(clubId)Accept club invitation
C_Club.DeclineInvitation(clubId)Decline club invitation
C_Club.GetInvitationsForSelf()invitationsPending invitations
C_Club.SendInvitation(clubId, memberId)Invite to club

Club Streams (Chat Channels within Clubs)

FunctionReturnsDescription
C_Club.GetStreams(clubId)streamsAll streams for club
C_Club.GetStreamInfo(clubId, streamId)infoStream info
C_Club.CreateStream(clubId, name, subject, leadersAndModeratorsOnly)Create stream
C_Club.DestroyStream(clubId, streamId)Remove stream
C_Club.EditStream(clubId, streamId, name, subject, leadersAndModeratorsOnly)Edit stream
C_Club.GetMessagesBefore(clubId, streamId, messageId, count)messagesFetch messages before ID
C_Club.GetMessagesAfter(clubId, streamId, messageId, count)messagesFetch messages after ID
C_Club.GetMessagesInRange(clubId, streamId, oldest, newest)messagesMessages in range
C_Club.SendMessage(clubId, streamId, message)Send message to stream
C_Club.FocusStream(clubId, streamId)Focus a stream
C_Club.UnfocusStream(clubId, streamId)Unfocus a stream
C_Club.SetAutoAdvanceStreamViewMarker(clubId, streamId)Auto-advance view marker

Club Types

EnumValueDescription
Enum.ClubType.BattleNet0BattleNet community
Enum.ClubType.Character1Character community
Enum.ClubType.Guild2Guild (treated as club)
Enum.ClubType.Other3Other

C_ClubFinder — Club Finder / Recruitment

FunctionReturnsDescription
C_ClubFinder.RequestClubsList(type, isLinkedSearch, searchText, specIDs)Search for clubs
C_ClubFinder.GetRecruitingClubInfoFromClubID(clubId)recruitInfoRecruitment info for club
C_ClubFinder.GetTotalMatchingCommunityListSize()sizeTotal matching communities
C_ClubFinder.GetTotalMatchingGuildListSize()sizeTotal matching guilds
C_ClubFinder.RequestPostingInformationFromClubId(clubId)Request posting info
C_ClubFinder.PostClub(clubId, minIlvl, minLevel, ...)Post club listing
C_ClubFinder.RequestApplicantList(type)Request applicant list
C_ClubFinder.GetApplicantInfoList()applicantsGet applicants
C_ClubFinder.RespondToApplicant(clubFinderGUID, playerGUID, accepted, ...)Respond to applicant

C_FriendList — Friends

FunctionReturnsDescription
C_FriendList.GetNumFriends()numFriendsCharacter friends count
C_FriendList.GetNumOnlineFriends()numOnlineOnline friends count
C_FriendList.GetFriendInfoByIndex(index)infoFriend info by index
C_FriendList.GetFriendInfoByName(name)infoFriend info by name
C_FriendList.GetFriendInfoByGUID(guid)infoFriend info by GUID
C_FriendList.AddFriend(name [, notes])Add friend
C_FriendList.RemoveFriend(name)Remove friend
C_FriendList.SetFriendNotes(name, notes)Set friend notes
C_FriendList.AddOrRemoveFriend(name, notes)Toggle friend
C_FriendList.IsFriend(guid)isFriendIs GUID a friend?
C_FriendList.AddIgnore(name)Add to ignore list
C_FriendList.DelIgnore(name)Remove from ignore list
C_FriendList.GetNumIgnores()numIgnoresIgnore list count
C_FriendList.GetIgnoreName(index)nameIgnored player name
C_FriendList.IsIgnored(name)isIgnoredIs player ignored?
C_FriendList.IsIgnoredByGUID(guid)isIgnoredIs GUID ignored?
C_FriendList.ShowFriends()Refresh friends list
C_FriendList.GetSelectedFriend()indexSelected friend index
C_FriendList.SetSelectedFriend(index)Select friend

C_BattleNet — BattleNet Friends

FunctionReturnsDescription
C_BattleNet.GetFriendAccountInfo(index)accountInfoBNet friend account info
C_BattleNet.GetFriendGameAccountInfo(index, gameAccountIndex)gameAccountInfoGame account info
C_BattleNet.GetFriendNumGameAccounts(index)numGameAccountsGame accounts for friend
C_BattleNet.GetAccountInfoByID(bnetAccountID)accountInfoAccount info by ID
C_BattleNet.GetAccountInfoByGUID(guid)accountInfoAccount info by GUID
C_BattleNet.GetGameAccountInfoByID(gameAccountID)gameAccountInfoGame account info
C_BattleNet.GetGameAccountInfoByGUID(guid)gameAccountInfoGame account by GUID
BNGetNumFriends()numFriends, numOnlineBNet friend count
BNGetNumFriendInvites()numInvitesPending BNet invites
BNSendWhisper(bnetAccountID, message)Send BNet whisper
BNInviteFriend(bnetAccountID)Invite to group
BNRequestInviteFriend(presenceID)Request BNet friend add
BNRemoveFriend(bnetAccountID)Remove BNet friend
BNSetFriendNote(bnetAccountID, note)Set friend note
BNSetCustomMessage(message)Set BNet status message
BNConnected()isConnectedConnected to BNet?

C_VoiceChat — Voice Chat

FunctionReturnsDescription
C_VoiceChat.GetActiveChannelID()channelIDActive voice channel
C_VoiceChat.GetChannel(channelID)channelChannel info
C_VoiceChat.GetChannelForChannelType(channelType)channelChannel by type
C_VoiceChat.GetChannelForCommunityStream(clubId, streamId)channelClub voice channel
C_VoiceChat.GetMasterVolumeScale()scaleMaster volume
C_VoiceChat.SetMasterVolumeScale(scale)Set master volume
C_VoiceChat.GetInputVolume()volumeMic volume
C_VoiceChat.SetInputVolume(volume)Set mic volume
C_VoiceChat.GetOutputVolume()volumeSpeaker volume
C_VoiceChat.SetOutputVolume(volume)Set speaker volume
C_VoiceChat.IsMuted()isMutedIs muted?
C_VoiceChat.SetMuted(muted)Set mute
C_VoiceChat.IsDeafened()isDeafenedIs deafened?
C_VoiceChat.SetDeafened(deafened)Set deafen
C_VoiceChat.IsSilenced()isSilencedIs silenced (by Blizzard)?
C_VoiceChat.ActivateChannel(channelID)Activate voice channel
C_VoiceChat.DeactivateChannel(channelID)Deactivate voice channel
C_VoiceChat.IsLoggedIn()isLoggedInVoice chat logged in?
C_VoiceChat.Login()Log in to voice chat
C_VoiceChat.Logout()Log out of voice chat
C_VoiceChat.GetMemberName(memberID, channelID)nameVoice member name
C_VoiceChat.GetMemberVolume(memberID, channelID)volumeMember volume
C_VoiceChat.SetMemberVolume(memberID, channelID, volume)Set member volume
C_VoiceChat.IsMemberMuted(memberID, channelID)isMutedIs member muted?
C_VoiceChat.SetMemberMuted(memberID, channelID, muted)Mute member

C_SocialRestrictions

FunctionReturnsDescription
C_SocialRestrictions.IsChatDisabled()isDisabledIs chat restricted?
C_SocialRestrictions.IsMuted()isMutedIs player muted?
C_SocialRestrictions.IsSilenced()isSilencedIs player silenced?
C_SocialRestrictions.IsSquelched()isSquelchedIs player squelched?

C_SocialQueue — Social Queue

FunctionReturnsDescription
C_SocialQueue.GetAllGroups()groupsAll social queue groups
C_SocialQueue.GetGroupInfo(guid)infoGroup queue info
C_SocialQueue.GetGroupMembers(guid)membersGroup member list
C_SocialQueue.GetGroupQueues(guid)queuesGroup queues

C_RecentAllies

FunctionReturnsDescription
C_RecentAllies.GetRecentAllies()alliesRecent group allies

C_PingManager — Ping System

FunctionReturnsDescription
C_PingManager.GetPingTypeFromUIMouseButton(button)pingTypePing type from mouse button
C_PingManager.TogglePingListener(enabled)Toggle ping listening

C_TTSSettings — Text-to-Speech

FunctionReturnsDescription
C_TTSSettings.GetChatTypeEnabled(chatType)enabledIs TTS enabled for chat type?
C_TTSSettings.SetChatTypeEnabled(chatType, enabled)Toggle TTS for chat type
C_TTSSettings.GetSetting(setting)valueGet TTS setting
C_TTSSettings.SetSetting(setting, value)Set TTS setting
C_TTSSettings.GetVoiceOptionID(voiceType)optionIDGet voice option

Common Patterns

Register and Handle Addon Messages

lua
local ADDON_PREFIX = "MyAddon"
C_ChatInfo.RegisterAddonMessagePrefix(ADDON_PREFIX)

local frame = CreateFrame("Frame")
frame:RegisterEvent("CHAT_MSG_ADDON")
frame:SetScript("OnEvent", function(self, event, prefix, message, channel, sender)
    if prefix == ADDON_PREFIX then
        -- Process addon message
        print("Got message from", sender, ":", message)
    end
end)

-- Send message (FAILS in instances in 12.0.0!)
local function SendMessage(msg, target)
    if not IsInInstance() then
        C_ChatInfo.SendAddonMessage(ADDON_PREFIX, msg, "PARTY")
    else
        -- In-instance: cannot send addon messages
        -- Consider using encounter events or built-in APIs instead
    end
end

Chat Message Filter

lua
-- Filter chat messages to modify or suppress them
ChatFrame_AddMessageEventFilter("CHAT_MSG_SAY", function(self, event, msg, author, ...)
    if msg:find("badword") then
        return true -- suppress the message
    end
    -- Modify the message
    local newMsg = msg:gsub("hello", "|cff00ff00hello|r")
    return false, newMsg, author, ...
end)

Enumerate Friends

lua
local function GetOnlineFriends()
    local friends = {}
    local numFriends = C_FriendList.GetNumFriends()
    for i = 1, numFriends do
        local info = C_FriendList.GetFriendInfoByIndex(i)
        if info and info.connected then
            table.insert(friends, info)
        end
    end
    -- Also check BNet friends
    local numBNet, numOnlineBNet = BNGetNumFriends()
    for i = 1, numBNet do
        local acctInfo = C_BattleNet.GetFriendAccountInfo(i)
        if acctInfo and acctInfo.gameAccountInfo and acctInfo.gameAccountInfo.isOnline then
            table.insert(friends, acctInfo)
        end
    end
    return friends
end

Key Events

EventPayloadDescription
CHAT_MSG_SAYmsg, author, language, channelString, target, flags, .../say message
CHAT_MSG_YELLmsg, author, .../yell message
CHAT_MSG_PARTYmsg, author, ...Party message
CHAT_MSG_PARTY_LEADERmsg, author, ...Party leader message
CHAT_MSG_RAIDmsg, author, ...Raid message
CHAT_MSG_RAID_LEADERmsg, author, ...Raid leader message
CHAT_MSG_GUILDmsg, author, ...Guild message
CHAT_MSG_OFFICERmsg, author, ...Guild officer message
CHAT_MSG_WHISPERmsg, author, ...Incoming whisper
CHAT_MSG_WHISPER_INFORMmsg, target, ...Outgoing whisper
CHAT_MSG_BN_WHISPERmsg, author, ...BNet whisper received
CHAT_MSG_BN_WHISPER_INFORMmsg, target, ...BNet whisper sent
CHAT_MSG_CHANNELmsg, author, language, channelString, target, flags, zoneChannelID, channelIndex, channelBaseName, ...Channel message
CHAT_MSG_ADDONprefix, message, channel, senderAddon message received
CHAT_MSG_ADDON_LOGGEDprefix, message, channel, senderLogged addon message
CHAT_MSG_SYSTEMmsgSystem message
CHAT_MSG_EMOTEmsg, author, ...Emote message
CHAT_MSG_TEXT_EMOTEmsg, author, .../emote text
FRIENDLIST_UPDATEFriends list changed
BN_FRIEND_LIST_SIZE_CHANGEDBNet list changed
BN_FRIEND_INFO_CHANGEDbnetAccountIDBNet friend updated
BN_CONNECTEDConnected to BNet
BN_DISCONNECTEDDisconnected from BNet
CLUB_ADDEDclubIdJoined a club
CLUB_REMOVEDclubIdLeft a club
CLUB_UPDATEDclubIdClub info updated
CLUB_MESSAGE_ADDEDclubId, streamId, messageIdNew club message
CLUB_MEMBER_ADDEDclubId, memberIdMember joined club
CLUB_MEMBER_REMOVEDclubId, memberIdMember left club
CLUB_MEMBER_UPDATEDclubId, memberIdMember info updated
VOICE_CHAT_CHANNEL_ACTIVATEDchannelIDVoice channel activated
VOICE_CHAT_CHANNEL_DEACTIVATEDchannelIDVoice channel deactivated
VOICE_CHAT_CHANNEL_MEMBER_ADDEDmemberID, channelIDMember joined voice
VOICE_CHAT_CHANNEL_MEMBER_REMOVEDmemberID, channelIDLeft voice channel

Gotchas & Restrictions

  1. SendAddonMessage BLOCKED in instancesC_ChatInfo.SendAddonMessage() and SendAddonMessageLogged() throw errors inside dungeons, raids, BGs, and arenas in 12.0.0.
  2. Chat messages may be secret — In instances, chat message content from other players may be KStrings / secret values.
  3. Addon prefix limit — Maximum 16 characters for addon message prefixes.
  4. Addon message size limit — Maximum 255 characters per addon message.
  5. Chat throttleSendChatMessage() is throttled. Sending too fast will disconnect you.
  6. Hardware event required — Some chat functions require a hardware event (mouse click/key press) to execute.
  7. BNet friend listBNGetFriendInfo() is deprecated. Use C_BattleNet.GetFriendAccountInfo().
  8. Club type Guild — Guilds are treated as clubs with Enum.ClubType.Guild. Use C_Club to interact with guild chat streams.
  9. Voice chat login — Voice chat requires explicit login. Check C_VoiceChat.IsLoggedIn() before operations.
  10. Chat filtersChatFrame_AddMessageEventFilter filters operate on ALL instances of the event across all chat frames.