############# ISteamFriends ############# .. note:: This documentation is auto-generated. Methods marked with 🤖 are automatically generated bindings. Methods marked with ✍️ are manually implemented and methods marked with ✋ are currently not implemented. List of Functions ----------------- * :func:`Friends.ActivateGameOverlay` * :func:`Friends.ActivateGameOverlayInviteDialog` * :func:`Friends.ActivateGameOverlayInviteDialogConnectString` * :func:`Friends.ActivateGameOverlayRemotePlayTogetherInviteDialog` * :func:`Friends.ActivateGameOverlayToStore` * :func:`Friends.ActivateGameOverlayToUser` * :func:`Friends.ActivateGameOverlayToWebPage` * :func:`Friends.BHasEquippedProfileItem` * :func:`Friends.ClearRichPresence` * :func:`Friends.CloseClanChatWindowInSteam` * :func:`Friends.DownloadClanActivityCounts` * :func:`Friends.EnumerateFollowingList` * :func:`Friends.GetChatMemberByIndex` * :func:`Friends.GetClanActivityCounts` * :func:`Friends.GetClanByIndex` * :func:`Friends.GetClanChatMemberCount` * :func:`Friends.GetClanChatMessage` * :func:`Friends.GetClanCount` * :func:`Friends.GetClanName` * :func:`Friends.GetClanOfficerByIndex` * :func:`Friends.GetClanOfficerCount` * :func:`Friends.GetClanOwner` * :func:`Friends.GetClanTag` * :func:`Friends.GetCoplayFriend` * :func:`Friends.GetCoplayFriendCount` * :func:`Friends.GetFollowerCount` * :func:`Friends.GetFriendByIndex` * :func:`Friends.GetFriendCoplayGame` * :func:`Friends.GetFriendCoplayTime` * :func:`Friends.GetFriendCount` * :func:`Friends.GetFriendCountFromSource` * :func:`Friends.GetFriendFromSourceByIndex` * :func:`Friends.GetFriendGamePlayed` * :func:`Friends.GetFriendMessage` * :func:`Friends.GetFriendPersonaName` * :func:`Friends.GetFriendPersonaNameHistory` * :func:`Friends.GetFriendPersonaState` * :func:`Friends.GetFriendRelationship` * :func:`Friends.GetFriendRichPresence` * :func:`Friends.GetFriendRichPresenceKeyByIndex` * :func:`Friends.GetFriendRichPresenceKeyCount` * :func:`Friends.GetFriendSteamLevel` * :func:`Friends.GetFriendsGroupCount` * :func:`Friends.GetFriendsGroupIDByIndex` * :func:`Friends.GetFriendsGroupMembersCount` * :func:`Friends.GetFriendsGroupMembersList` * :func:`Friends.GetFriendsGroupName` * :func:`Friends.GetLargeFriendAvatar` * :func:`Friends.GetMediumFriendAvatar` * :func:`Friends.GetNumChatsWithUnreadPriorityMessages` * :func:`Friends.GetPersonaName` * :func:`Friends.GetPersonaState` * :func:`Friends.GetPlayerNickname` * :func:`Friends.GetProfileItemPropertyString` * :func:`Friends.GetProfileItemPropertyUint` * :func:`Friends.GetSmallFriendAvatar` * :func:`Friends.HasFriend` * :func:`Friends.InviteUserToGame` * :func:`Friends.IsClanChatAdmin` * :func:`Friends.IsClanChatWindowOpenInSteam` * :func:`Friends.IsClanOfficialGameGroup` * :func:`Friends.IsClanPublic` * :func:`Friends.IsFollowing` * :func:`Friends.IsUserInSource` * :func:`Friends.JoinClanChatRoom` * :func:`Friends.LeaveClanChatRoom` * :func:`Friends.OpenClanChatWindowInSteam` * :func:`Friends.RegisterProtocolInOverlayBrowser` * :func:`Friends.ReplyToFriendMessage` * :func:`Friends.RequestClanOfficerList` * :func:`Friends.RequestEquippedProfileItems` * :func:`Friends.RequestFriendRichPresence` * :func:`Friends.RequestUserInformation` * :func:`Friends.SendClanChatMessage` * :func:`Friends.SetInGameVoiceSpeaking` * :func:`Friends.SetListenForFriendsMessages` * :func:`Friends.SetPlayedWith` * :func:`Friends.SetRichPresence` List of Callbacks ----------------- * :func:`Friends.OnPersonaStateChange` * :func:`Friends.OnGameOverlayActivated` * :func:`Friends.OnGameServerChangeRequested` * :func:`Friends.OnGameLobbyJoinRequested` * :func:`Friends.OnAvatarImageLoaded` * :func:`Friends.OnClanOfficerListResponse` * :func:`Friends.OnFriendRichPresenceUpdate` * :func:`Friends.OnGameRichPresenceJoinRequested` * :func:`Friends.OnGameConnectedClanChatMsg` * :func:`Friends.OnGameConnectedChatJoin` * :func:`Friends.OnGameConnectedChatLeave` * :func:`Friends.OnDownloadClanActivityCountsResult` * :func:`Friends.OnJoinClanChatRoomCompletionResult` * :func:`Friends.OnGameConnectedFriendChatMsg` * :func:`Friends.OnFriendsGetFollowerCount` * :func:`Friends.OnFriendsIsFollowing` * :func:`Friends.OnFriendsEnumerateFollowingList` * :func:`Friends.OnUnreadChatMessagesChanged` * :func:`Friends.OnOverlayBrowserProtocolNavigation` * :func:`Friends.OnEquippedProfileItemsChanged` * :func:`Friends.OnEquippedProfileItems` Function Reference ------------------ .. function:: Friends.ActivateGameOverlay(pchDialog) 🤖 **Auto-generated binding** :param str? pchDialog: :SteamWorks: `ActivateGameOverlay `_ **Example**:: Steam.Friends.ActivateGameOverlay('stats') .. function:: Friends.ActivateGameOverlayInviteDialog(steamIDLobby) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDLobby: :SteamWorks: `ActivateGameOverlayInviteDialog `_ **Example**:: -- Open the Steam overlay invite dialog for a lobby Steam.Friends.ActivateGameOverlayInviteDialog(lobbyID) .. function:: Friends.ActivateGameOverlayInviteDialogConnectString(pchConnectString) 🤖 **Auto-generated binding** :param str? pchConnectString: :SteamWorks: `ActivateGameOverlayInviteDialogConnectString `_ .. function:: Friends.ActivateGameOverlayRemotePlayTogetherInviteDialog(steamIDLobby) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDLobby: :SteamWorks: `ActivateGameOverlayRemotePlayTogetherInviteDialog `_ .. function:: Friends.ActivateGameOverlayToStore(nAppID, eFlag) 🤖 **Auto-generated binding** :param int - AppId_t nAppID: :param int - EOverlayToStoreFlag eFlag: :SteamWorks: `ActivateGameOverlayToStore `_ **Example**:: Steam.Friends.ActivateGameOverlayToStore(Steam.Utils.GetAppID(), Steam.k_EOverlayToStoreFlag_AddToCartAndShow) .. function:: Friends.ActivateGameOverlayToUser(pchDialog, steamID) 🤖 **Auto-generated binding** :param str? pchDialog: :param uint64 - CSteamID steamID: :SteamWorks: `ActivateGameOverlayToUser `_ **Example**:: Steam.Friends.ActivateGameOverlayToUser('steamid', friendSteamID) .. function:: Friends.ActivateGameOverlayToWebPage(pchURL, eMode) 🤖 **Auto-generated binding** :param str? pchURL: :param int - EActivateGameOverlayToWebPageMode eMode: :SteamWorks: `ActivateGameOverlayToWebPage `_ **Example**:: Steam.Friends.ActivateGameOverlayToWebPage('https://www.google.com') .. function:: Friends.BHasEquippedProfileItem(steamID, itemType) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamID: :param int - ECommunityProfileItemType itemType: :returns: (bool) Return value :SteamWorks: `BHasEquippedProfileItem `_ .. function:: Friends.ClearRichPresence() 🤖 **Auto-generated binding** :SteamWorks: `ClearRichPresence `_ **Example**:: Steam.Friends.ClearRichPresence() .. function:: Friends.CloseClanChatWindowInSteam(steamIDClanChat) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClanChat: :returns: (bool) Return value :SteamWorks: `CloseClanChatWindowInSteam `_ .. function:: Friends.DownloadClanActivityCounts(cClansToRequest, callback) 🤖 **Auto-generated binding** :param int? cClansToRequest: size of the buffer to allocate for ``psteamIDClans``. If ``nil`` then the buffer will be ``NULL``. :param function callback: CallResult callback receiving struct :func:`DownloadClanActivityCountsResult_t ` and a boolean :returns: (uint64) ``SteamAPICall_t`` handle for this async call. The result is delivered via the ``callback`` parameter when :func:`Steam.RunCallbacks` is called. :returns: (uint64[]) ``psteamIDClans`` :SteamWorks: `DownloadClanActivityCounts `_ **Signature differences from C++ API:** * Parameter ``psteamIDClans`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. .. function:: Friends.EnumerateFollowingList(unStartIndex, callback) 🤖 **Auto-generated binding** :param int unStartIndex: :param function callback: CallResult callback receiving struct :func:`FriendsEnumerateFollowingList_t ` and a boolean :returns: (uint64) ``SteamAPICall_t`` handle for this async call. The result is delivered via the ``callback`` parameter when :func:`Steam.RunCallbacks` is called. :SteamWorks: `EnumerateFollowingList `_ .. function:: Friends.GetChatMemberByIndex(steamIDClan, iUser) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :param int iUser: :returns: (uint64 - CSteamID) Return value :SteamWorks: `GetChatMemberByIndex `_ .. function:: Friends.GetClanActivityCounts(steamIDClan) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :returns: (bool) Return value :returns: (int) ``pnOnline`` :returns: (int) ``pnInGame`` :returns: (int) ``pnChatting`` :SteamWorks: `GetClanActivityCounts `_ **Signature differences from C++ API:** * Parameter ``pnOnline`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. * Parameter ``pnInGame`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. * Parameter ``pnChatting`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. .. function:: Friends.GetClanByIndex(iClan) 🤖 **Auto-generated binding** :param int iClan: :returns: (uint64 - CSteamID) Return value :SteamWorks: `GetClanByIndex `_ **Notes:** * See :func:`Friends.GetClanCount`'s example. .. function:: Friends.GetClanChatMemberCount(steamIDClan) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :returns: (int) Return value :SteamWorks: `GetClanChatMemberCount `_ .. function:: Friends.GetClanChatMessage(steamIDClanChat, iMessage, cchTextMax) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClanChat: :param int iMessage: :param int? cchTextMax: size of the buffer to allocate for ``prgchText``. If ``nil`` then the buffer will be ``NULL``. :returns: (int) Return value :returns: (str) ``prgchText`` :returns: (int) ``peChatEntryType`` :returns: (uint64) ``psteamidChatter`` :SteamWorks: `GetClanChatMessage `_ **Signature differences from C++ API:** * Parameter ``prgchText`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. * Parameter ``peChatEntryType`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. * Parameter ``psteamidChatter`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. .. function:: Friends.GetClanCount() 🤖 **Auto-generated binding** :returns: (int) Return value :SteamWorks: `GetClanCount `_ **Example**:: local count = Steam.Friends.GetClanCount() for i = 0, count - 1 do local clanID = Steam.Friends.GetClanByIndex(i) print('Clan: ' .. Steam.Friends.GetClanName(clanID)) end .. function:: Friends.GetClanName(steamIDClan) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :returns: (str) Return value :SteamWorks: `GetClanName `_ **Notes:** * See :func:`Friends.GetClanCount`'s example. .. function:: Friends.GetClanOfficerByIndex(steamIDClan, iOfficer) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :param int iOfficer: :returns: (uint64 - CSteamID) Return value :SteamWorks: `GetClanOfficerByIndex `_ **Notes:** * See :func:`Friends.GetClanOfficerCount`'s example. .. function:: Friends.GetClanOfficerCount(steamIDClan) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :returns: (int) Return value :SteamWorks: `GetClanOfficerCount `_ **Example**:: local count = Steam.Friends.GetClanOfficerCount(clanID) for i = 0, count - 1 do local officerID = Steam.Friends.GetClanOfficerByIndex(clanID, i) print('Officer:', Steam.Friends.GetFriendPersonaName(officerID)) end .. function:: Friends.GetClanOwner(steamIDClan) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :returns: (uint64 - CSteamID) Return value :SteamWorks: `GetClanOwner `_ **Example**:: local ownerID = Steam.Friends.GetClanOwner(clanID) print('Clan owner:', Steam.Friends.GetFriendPersonaName(ownerID)) .. function:: Friends.GetClanTag(steamIDClan) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :returns: (str) Return value :SteamWorks: `GetClanTag `_ .. function:: Friends.GetCoplayFriend(iCoplayFriend) 🤖 **Auto-generated binding** :param int iCoplayFriend: :returns: (uint64 - CSteamID) Return value :SteamWorks: `GetCoplayFriend `_ .. function:: Friends.GetCoplayFriendCount() 🤖 **Auto-generated binding** :returns: (int) Return value :SteamWorks: `GetCoplayFriendCount `_ .. function:: Friends.GetFollowerCount(steamID, callback) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamID: :param function callback: CallResult callback receiving struct :func:`FriendsGetFollowerCount_t ` and a boolean :returns: (uint64) ``SteamAPICall_t`` handle for this async call. The result is delivered via the ``callback`` parameter when :func:`Steam.RunCallbacks` is called. :SteamWorks: `GetFollowerCount `_ **Example**:: Steam.Friends.GetFollowerCount(playerID, function(data, err) if not err then print('Follower count:', data.m_nCount) end end) .. function:: Friends.GetFriendByIndex(iFriend, iFriendFlags) 🤖 **Auto-generated binding** :param int iFriend: :param int iFriendFlags: :returns: (uint64 - CSteamID) Return value :SteamWorks: `GetFriendByIndex `_ **Example**:: local count = Steam.Friends.GetFriendCount(Steam.k_EFriendFlagAll) for i = 0, count - 1 do local friend_id = Steam.Friends.GetFriendByIndex(i, Steam.k_EFriendFlagAll) print(Steam.Friends.GetFriendPersonaName(friend_id)) end .. function:: Friends.GetFriendCoplayGame(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (int - AppId_t) Return value :SteamWorks: `GetFriendCoplayGame `_ **Example**:: local gameID = Steam.Friends.GetFriendCoplayGame(friendID) print('Friend last co-op game:', tostring(gameID)) .. function:: Friends.GetFriendCoplayTime(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (int) Return value :SteamWorks: `GetFriendCoplayTime `_ .. function:: Friends.GetFriendCount(iFriendFlags) 🤖 **Auto-generated binding** :param int iFriendFlags: :returns: (int) Return value :SteamWorks: `GetFriendCount `_ **Example**:: local count = Steam.Friends.GetFriendCount(Steam.k_EFriendFlagAll) print('You have ' .. count .. ' friends') .. function:: Friends.GetFriendCountFromSource(steamIDSource) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDSource: :returns: (int) Return value :SteamWorks: `GetFriendCountFromSource `_ .. function:: Friends.GetFriendFromSourceByIndex(steamIDSource, iFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDSource: :param int iFriend: :returns: (uint64 - CSteamID) Return value :SteamWorks: `GetFriendFromSourceByIndex `_ .. function:: Friends.GetFriendGamePlayed(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (bool) Return value :returns: (:ref:`FriendGameInfo_t `) ``pFriendGameInfo`` :SteamWorks: `GetFriendGamePlayed `_ **Signature differences from C++ API:** * Parameter ``pFriendGameInfo`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. **Example**:: local is_friend, pFriendGameInfo = Steam.Friends.GetFriendGamePlayed(friendID) if is_friend then print('Friend is playing game:', pFriendGameInfo.m_gameID) end .. function:: Friends.GetFriendMessage(steamIDFriend, iMessageID, cubData) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :param int iMessageID: :param int? cubData: size of the buffer to allocate for ``pvData``. If ``nil`` then the buffer will be ``NULL``. :returns: (int) Return value :returns: (str) ``pvData`` :returns: (int) ``peChatEntryType`` :SteamWorks: `GetFriendMessage `_ **Signature differences from C++ API:** * Parameter ``pvData`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. * Parameter ``peChatEntryType`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. .. function:: Friends.GetFriendPersonaName(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (str) Return value :SteamWorks: `GetFriendPersonaName `_ **Example**:: local friend_id = getSteamIdSomehow() print("Friend's name is: " .. Steam.Friends.GetFriendPersonaName(friend_id)) .. function:: Friends.GetFriendPersonaNameHistory(steamIDFriend, iPersonaName) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :param int iPersonaName: :returns: (str) Return value :SteamWorks: `GetFriendPersonaNameHistory `_ .. function:: Friends.GetFriendPersonaState(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (int - EPersonaState) Return value :SteamWorks: `GetFriendPersonaState `_ **Example**:: local state = Steam.Friends.GetFriendPersonaState(friendID) if state == Steam.k_EPersonaStateOnline then print('Friend is online') end .. function:: Friends.GetFriendRelationship(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (int - EFriendRelationship) Return value :SteamWorks: `GetFriendRelationship `_ **Example**:: local rel = Steam.Friends.GetFriendRelationship(playerID) if rel == Steam.k_EFriendRelationshipFriend then print('This player is your friend') end .. function:: Friends.GetFriendRichPresence(steamIDFriend, pchKey) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :param str? pchKey: :returns: (str) Return value :SteamWorks: `GetFriendRichPresence `_ **Example**:: local value = Steam.Friends.GetFriendRichPresence(friend_id, 'steam_display') print('Rich presence: ' .. value) .. function:: Friends.GetFriendRichPresenceKeyByIndex(steamIDFriend, iKey) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :param int iKey: :returns: (str) Return value :SteamWorks: `GetFriendRichPresenceKeyByIndex `_ **Notes:** * See :func:`Friends.GetFriendRichPresenceKeyCount`'s example. .. function:: Friends.GetFriendRichPresenceKeyCount(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (int) Return value :SteamWorks: `GetFriendRichPresenceKeyCount `_ **Example**:: local count = Steam.Friends.GetFriendRichPresenceKeyCount(friendID) for i = 0, count - 1 do local key = Steam.Friends.GetFriendRichPresenceKeyByIndex(friendID, i) local val = Steam.Friends.GetFriendRichPresence(friendID, key) print(key .. ' = ' .. val) end .. function:: Friends.GetFriendSteamLevel(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (int) Return value :SteamWorks: `GetFriendSteamLevel `_ **Example**:: local level = Steam.Friends.GetFriendSteamLevel(friendID) print('Friend Steam level:', level) .. function:: Friends.GetFriendsGroupCount() 🤖 **Auto-generated binding** :returns: (int) Return value :SteamWorks: `GetFriendsGroupCount `_ **Example**:: local groupCount = Steam.Friends.GetFriendsGroupCount() for i = 0, groupCount - 1 do local groupID = Steam.Friends.GetFriendsGroupIDByIndex(i) print('Group: ' .. Steam.Friends.GetFriendsGroupName(groupID)) end .. function:: Friends.GetFriendsGroupIDByIndex(iFG) 🤖 **Auto-generated binding** :param int iFG: :returns: (int - FriendsGroupID_t) Return value :SteamWorks: `GetFriendsGroupIDByIndex `_ **Notes:** * See :func:`Friends.GetFriendsGroupCount`'s example. .. function:: Friends.GetFriendsGroupMembersCount(friendsGroupID) 🤖 **Auto-generated binding** :param int - FriendsGroupID_t friendsGroupID: :returns: (int) Return value :SteamWorks: `GetFriendsGroupMembersCount `_ .. function:: Friends.GetFriendsGroupMembersList(friendsGroupID, nMembersCount) 🤖 **Auto-generated binding** :param int - FriendsGroupID_t friendsGroupID: :param int? nMembersCount: size of the buffer to allocate for ``pOutSteamIDMembers``. If ``nil`` then the buffer will be ``NULL``. :returns: (uint64[]) ``pOutSteamIDMembers`` :SteamWorks: `GetFriendsGroupMembersList `_ **Signature differences from C++ API:** * Parameter ``pOutSteamIDMembers`` is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value. .. function:: Friends.GetFriendsGroupName(friendsGroupID) 🤖 **Auto-generated binding** :param int - FriendsGroupID_t friendsGroupID: :returns: (str) Return value :SteamWorks: `GetFriendsGroupName `_ **Notes:** * See :func:`Friends.GetFriendsGroupCount`'s example. .. function:: Friends.GetLargeFriendAvatar(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (int) Return value :SteamWorks: `GetLargeFriendAvatar `_ **Notes:** * See :func:`Friends.GetSmallFriendAvatar`'s example. .. function:: Friends.GetMediumFriendAvatar(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (int) Return value :SteamWorks: `GetMediumFriendAvatar `_ **Notes:** * See :func:`Friends.GetSmallFriendAvatar`'s example. .. function:: Friends.GetNumChatsWithUnreadPriorityMessages() 🤖 **Auto-generated binding** :returns: (int) Return value :SteamWorks: `GetNumChatsWithUnreadPriorityMessages `_ .. function:: Friends.GetPersonaName() 🤖 **Auto-generated binding** :returns: (str) Return value :SteamWorks: `GetPersonaName `_ Gets the current user's persona (display) name. **Example**:: print('My name is: ' .. Steam.Friends.GetPersonaName()) .. function:: Friends.GetPersonaState() 🤖 **Auto-generated binding** :returns: (int - EPersonaState) Return value :SteamWorks: `GetPersonaState `_ **Example**:: local state = Steam.Friends.GetPersonaState() if state == Steam.k_EPersonaStateOnline then print('User is online') end .. function:: Friends.GetPlayerNickname(steamIDPlayer) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDPlayer: :returns: (str) Return value :SteamWorks: `GetPlayerNickname `_ **Example**:: local nick = Steam.Friends.GetPlayerNickname(friendID) if nick then print('Your nickname for this friend: ' .. nick) end .. function:: Friends.GetProfileItemPropertyString(steamID, itemType, prop) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamID: :param int - ECommunityProfileItemType itemType: :param int - ECommunityProfileItemProperty prop: :returns: (str) Return value :SteamWorks: `GetProfileItemPropertyString `_ .. function:: Friends.GetProfileItemPropertyUint(steamID, itemType, prop) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamID: :param int - ECommunityProfileItemType itemType: :param int - ECommunityProfileItemProperty prop: :returns: (int) Return value :SteamWorks: `GetProfileItemPropertyUint `_ .. function:: Friends.GetSmallFriendAvatar(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :returns: (int) Return value :SteamWorks: `GetSmallFriendAvatar `_ **Example**:: local imageHandle = Steam.Friends.GetSmallFriendAvatar(friendID) if imageHandle > 0 then local w, h = Steam.Utils.GetImageSize(imageHandle) local ok, rgba = Steam.Utils.GetImageRGBA(imageHandle, w * h * 4) if ok then -- RGBA is a lua string with binary data of the pixels renderAvatar(rgba, w, h) end end .. function:: Friends.HasFriend(steamIDFriend, iFriendFlags) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :param int iFriendFlags: :returns: (bool) Return value :SteamWorks: `HasFriend `_ **Example**:: if Steam.Friends.HasFriend(playerID, Steam.k_EFriendFlagImmediate) then print('This player is a direct friend') end .. function:: Friends.InviteUserToGame(steamIDFriend, pchConnectString) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :param str? pchConnectString: :returns: (bool) Return value :SteamWorks: `InviteUserToGame `_ **Example**:: -- Invite a friend to your server Steam.Friends.InviteUserToGame(friend_id, '+connect 1.2.3.4:27015') .. function:: Friends.IsClanChatAdmin(steamIDClanChat, steamIDUser) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClanChat: :param uint64 - CSteamID steamIDUser: :returns: (bool) Return value :SteamWorks: `IsClanChatAdmin `_ .. function:: Friends.IsClanChatWindowOpenInSteam(steamIDClanChat) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClanChat: :returns: (bool) Return value :SteamWorks: `IsClanChatWindowOpenInSteam `_ .. function:: Friends.IsClanOfficialGameGroup(steamIDClan) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :returns: (bool) Return value :SteamWorks: `IsClanOfficialGameGroup `_ .. function:: Friends.IsClanPublic(steamIDClan) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :returns: (bool) Return value :SteamWorks: `IsClanPublic `_ .. function:: Friends.IsFollowing(steamID, callback) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamID: :param function callback: CallResult callback receiving struct :func:`FriendsIsFollowing_t ` and a boolean :returns: (uint64) ``SteamAPICall_t`` handle for this async call. The result is delivered via the ``callback`` parameter when :func:`Steam.RunCallbacks` is called. :SteamWorks: `IsFollowing `_ **Example**:: Steam.Friends.IsFollowing(playerID, function(data, err) if not err then print('Following:', data.m_bIsFollowing) end end) .. function:: Friends.IsUserInSource(steamIDUser, steamIDSource) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDUser: :param uint64 - CSteamID steamIDSource: :returns: (bool) Return value :SteamWorks: `IsUserInSource `_ .. function:: Friends.JoinClanChatRoom(steamIDClan, callback) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :param function callback: CallResult callback receiving struct :func:`JoinClanChatRoomCompletionResult_t ` and a boolean :returns: (uint64) ``SteamAPICall_t`` handle for this async call. The result is delivered via the ``callback`` parameter when :func:`Steam.RunCallbacks` is called. :SteamWorks: `JoinClanChatRoom `_ **Example**:: Steam.Friends.JoinClanChatRoom(clanID, function(data, err) if not err and data.m_eChatRoomEnterResponse == 1 then print('Joined clan chat:', data.m_steamIDClanChat) end end) .. function:: Friends.LeaveClanChatRoom(steamIDClan) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :returns: (bool) Return value :SteamWorks: `LeaveClanChatRoom `_ .. function:: Friends.OpenClanChatWindowInSteam(steamIDClanChat) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClanChat: :returns: (bool) Return value :SteamWorks: `OpenClanChatWindowInSteam `_ .. function:: Friends.RegisterProtocolInOverlayBrowser(pchProtocol) 🤖 **Auto-generated binding** :param str? pchProtocol: :returns: (bool) Return value :SteamWorks: `RegisterProtocolInOverlayBrowser `_ .. function:: Friends.ReplyToFriendMessage(steamIDFriend, pchMsgToSend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :param str? pchMsgToSend: :returns: (bool) Return value :SteamWorks: `ReplyToFriendMessage `_ .. function:: Friends.RequestClanOfficerList(steamIDClan, callback) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClan: :param function callback: CallResult callback receiving struct :func:`ClanOfficerListResponse_t ` and a boolean :returns: (uint64) ``SteamAPICall_t`` handle for this async call. The result is delivered via the ``callback`` parameter when :func:`Steam.RunCallbacks` is called. :SteamWorks: `RequestClanOfficerList `_ .. function:: Friends.RequestEquippedProfileItems(steamID, callback) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamID: :param function callback: CallResult callback receiving struct :func:`EquippedProfileItems_t ` and a boolean :returns: (uint64) ``SteamAPICall_t`` handle for this async call. The result is delivered via the ``callback`` parameter when :func:`Steam.RunCallbacks` is called. :SteamWorks: `RequestEquippedProfileItems `_ .. function:: Friends.RequestFriendRichPresence(steamIDFriend) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDFriend: :SteamWorks: `RequestFriendRichPresence `_ **Example**:: -- Request fresh rich presence data for a friend Steam.Friends.RequestFriendRichPresence(friendID) .. function:: Friends.RequestUserInformation(steamIDUser, bRequireNameOnly) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDUser: :param bool bRequireNameOnly: :returns: (bool) Return value :SteamWorks: `RequestUserInformation `_ **Example**:: -- Request the player name and avatar; returns true if data needs to be fetched local needsData = Steam.Friends.RequestUserInformation(playerID, true) if needsData then -- Wait for OnPersonaStateChange callback end .. function:: Friends.SendClanChatMessage(steamIDClanChat, pchText) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDClanChat: :param str? pchText: :returns: (bool) Return value :SteamWorks: `SendClanChatMessage `_ **Example**:: Steam.Friends.SendClanChatMessage(clanChatID, 'Hello clan!') .. function:: Friends.SetInGameVoiceSpeaking(steamIDUser, bSpeaking) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDUser: :param bool bSpeaking: :SteamWorks: `SetInGameVoiceSpeaking `_ **Example**:: -- Notify Steam that this user is speaking in-game Steam.Friends.SetInGameVoiceSpeaking(Steam.User.GetSteamID(), true) .. function:: Friends.SetListenForFriendsMessages(bInterceptEnabled) 🤖 **Auto-generated binding** :param bool bInterceptEnabled: :returns: (bool) Return value :SteamWorks: `SetListenForFriendsMessages `_ **Example**:: -- Enable friend message interception Steam.Friends.SetListenForFriendsMessages(true) .. function:: Friends.SetPlayedWith(steamIDUserPlayedWith) 🤖 **Auto-generated binding** :param uint64 - CSteamID steamIDUserPlayedWith: :SteamWorks: `SetPlayedWith `_ **Example**:: for _, playerID in ipairs(currentPlayers) do Steam.Friends.SetPlayedWith(playerID) end .. function:: Friends.SetRichPresence(pchKey, pchValue) 🤖 **Auto-generated binding** :param str? pchKey: The Rich Presence key to set :param str? pchValue: The value to associate with the key :returns: (bool) Return value :SteamWorks: `SetRichPresence `_ Sets a Rich Presence key/value for the current user that is shared with friends. **Example**:: Steam.Friends.SetRichPresence('steam_display', '#StatusWithScore') Steam.Friends.SetRichPresence('score', tostring(myScore)) Callbacks --------- .. function:: Friends.OnPersonaStateChange Callback for `PersonaStateChange_t `_ **callback(data)** receives: * **data.m_ulSteamID** *(uint64)* * **data.m_nChangeFlags** *(int)* **Example**:: function Steam.Friends.OnPersonaStateChange(data) local name = Steam.Friends.GetFriendPersonaName(data.m_ulSteamID) print('Persona changed for:', name) end .. function:: Friends.OnGameOverlayActivated Callback for `GameOverlayActivated_t `_ **callback(data)** receives: * **data.m_bActive** *(int)* * **data.m_bUserInitiated** *(bool)* * **data.m_nAppID** *(int - AppId_t)* * **data.m_dwOverlayPID** *(int)* **Example**:: function Steam.Friends.OnGameOverlayActivated(data) if data.m_bActive == 1 then print('Game overlay opened, pausing game') else print('Game overlay closed, resuming game') end end .. function:: Friends.OnGameServerChangeRequested Callback for `GameServerChangeRequested_t `_ **callback(data)** receives: * **data.m_rgchServer** *(string)* * **data.m_rgchPassword** *(string)* **Example**:: function Steam.Friends.OnGameServerChangeRequested(data) print('Friend invites you to server:', data.m_rgchServer) connectToServer(data.m_rgchServer, data.m_rgchPassword) end .. function:: Friends.OnGameLobbyJoinRequested Callback for `GameLobbyJoinRequested_t `_ **callback(data)** receives: * **data.m_steamIDLobby** *(uint64 - CSteamID)* * **data.m_steamIDFriend** *(uint64 - CSteamID)* **Example**:: function Steam.Friends.OnGameLobbyJoinRequested(data) Steam.Matchmaking.JoinLobby(data.m_steamIDLobby, function(result, err) if not err and result.m_EChatRoomEnterResponse == 1 then print('Joined lobby from friend invite') end end) end .. function:: Friends.OnAvatarImageLoaded Callback for `AvatarImageLoaded_t `_ **callback(data)** receives: * **data.m_steamID** *(uint64 - CSteamID)* * **data.m_iImage** *(int)* * **data.m_iWide** *(int)* * **data.m_iTall** *(int)* **Example**:: function Steam.Friends.OnAvatarImageLoaded(data) local w, h = Steam.Utils.GetImageSize(data.m_iImage) local _, rgba = Steam.Utils.GetImageRGBA(data.m_iImage, w * h * 4) updateAvatarTexture(data.m_steamID, rgba, w, h) end .. function:: Friends.OnClanOfficerListResponse Callback for `ClanOfficerListResponse_t `_ **callback(data)** receives: * **data.m_steamIDClan** *(uint64 - CSteamID)* * **data.m_cOfficers** *(int)* * **data.m_bSuccess** *(int)* .. function:: Friends.OnFriendRichPresenceUpdate Callback for `FriendRichPresenceUpdate_t `_ **callback(data)** receives: * **data.m_steamIDFriend** *(uint64 - CSteamID)* * **data.m_nAppID** *(int - AppId_t)* **Example**:: function Steam.Friends.OnFriendRichPresenceUpdate(data) local status = Steam.Friends.GetFriendRichPresence(data.m_steamIDFriend, 'status') print('Friend presence updated:', status) end .. function:: Friends.OnGameRichPresenceJoinRequested Callback for `GameRichPresenceJoinRequested_t `_ **callback(data)** receives: * **data.m_steamIDFriend** *(uint64 - CSteamID)* * **data.m_rgchConnect** *(string)* **Example**:: function Steam.Friends.OnGameRichPresenceJoinRequested(data) local connect_string = data.m_rgchConnect initiateJoinGame(connect_string) end .. function:: Friends.OnGameConnectedClanChatMsg Callback for `GameConnectedClanChatMsg_t `_ **callback(data)** receives: * **data.m_steamIDClanChat** *(uint64 - CSteamID)* * **data.m_steamIDUser** *(uint64 - CSteamID)* * **data.m_iMessageID** *(int)* .. function:: Friends.OnGameConnectedChatJoin Callback for `GameConnectedChatJoin_t `_ **callback(data)** receives: * **data.m_steamIDClanChat** *(uint64 - CSteamID)* * **data.m_steamIDUser** *(uint64 - CSteamID)* .. function:: Friends.OnGameConnectedChatLeave Callback for `GameConnectedChatLeave_t `_ **callback(data)** receives: * **data.m_steamIDClanChat** *(uint64 - CSteamID)* * **data.m_steamIDUser** *(uint64 - CSteamID)* * **data.m_bKicked** *(bool)* * **data.m_bDropped** *(bool)* .. function:: Friends.OnDownloadClanActivityCountsResult Callback for `DownloadClanActivityCountsResult_t `_ **callback(data)** receives: * **data.m_bSuccess** *(bool)* .. function:: Friends.OnJoinClanChatRoomCompletionResult Callback for `JoinClanChatRoomCompletionResult_t `_ **callback(data)** receives: * **data.m_steamIDClanChat** *(uint64 - CSteamID)* * **data.m_eChatRoomEnterResponse** *(int - EChatRoomEnterResponse)* .. function:: Friends.OnGameConnectedFriendChatMsg Callback for `GameConnectedFriendChatMsg_t `_ **callback(data)** receives: * **data.m_steamIDUser** *(uint64 - CSteamID)* * **data.m_iMessageID** *(int)* **Example**:: function Steam.Friends.OnGameConnectedFriendChatMsg(data) local msg, chatType = Steam.Friends.GetFriendMessage(data.m_steamIDUser, data.m_iMessageID, 512) print('Friend chat:', msg) end .. function:: Friends.OnFriendsGetFollowerCount Callback for `FriendsGetFollowerCount_t `_ **callback(data)** receives: * **data.m_eResult** *(int - EResult)* * **data.m_steamID** *(uint64 - CSteamID)* * **data.m_nCount** *(int)* .. function:: Friends.OnFriendsIsFollowing Callback for `FriendsIsFollowing_t `_ **callback(data)** receives: * **data.m_eResult** *(int - EResult)* * **data.m_steamID** *(uint64 - CSteamID)* * **data.m_bIsFollowing** *(bool)* .. function:: Friends.OnFriendsEnumerateFollowingList Callback for `FriendsEnumerateFollowingList_t `_ **callback(data)** receives: * **data.m_eResult** *(int - EResult)* * **data.m_rgSteamID** *(uint64[] - CSteamID)* * **data.m_nResultsReturned** *(int)* * **data.m_nTotalResultCount** *(int)* .. function:: Friends.OnUnreadChatMessagesChanged Callback for `UnreadChatMessagesChanged_t `_ **callback(data)** receives no fields (notification only). **Example**:: function Steam.Friends.OnUnreadChatMessagesChanged() local count = Steam.Friends.GetNumChatsWithUnreadPriorityMessages() if count > 0 then print('You have', count, 'unread priority messages') end end .. function:: Friends.OnOverlayBrowserProtocolNavigation Callback for `OverlayBrowserProtocolNavigation_t `_ **callback(data)** receives: * **data.rgchURI** *(string)* .. function:: Friends.OnEquippedProfileItemsChanged Callback for `EquippedProfileItemsChanged_t `_ **callback(data)** receives: * **data.m_steamID** *(uint64 - CSteamID)* .. function:: Friends.OnEquippedProfileItems Callback for `EquippedProfileItems_t `_ **callback(data)** receives: * **data.m_eResult** *(int - EResult)* * **data.m_steamID** *(uint64 - CSteamID)* * **data.m_bHasAnimatedAvatar** *(bool)* * **data.m_bHasAvatarFrame** *(bool)* * **data.m_bHasProfileModifier** *(bool)* * **data.m_bHasProfileBackground** *(bool)* * **data.m_bHasMiniProfileBackground** *(bool)* * **data.m_bFromCache** *(bool)*