Type String Revision Release 2024.3703 Keywords steam, steamworks, getUserInfo, UserInfo, relationship See also steamworks.getUserInfo() steamworks.*
A string indicating a user's relationship status with the currently logged in user.
This will be one of the following strings:
"blocked"
"friend"
"ignored"
"ignoredFriend"
"none"
"requestRecipient"
"requestInitiator"
"suggested"
"unknown"
If the UserInfo object references the currently logged in user, this property will always be "none"
.
local steamworks = require( "plugin.steamworks" ) -- Set the user ID of the friend to fetch information for local friendSteamId = "FRIEND_ID" -- Function used to print the above friend's relationship to the log local function fetchFriendInfo() local userInfo = steamworks.getUserInfo( friendSteamId ) if ( userInfo ) then -- Friend's info was successfully fetched print( "Relationship: " .. userInfo.relationship ) else -- Friend's info has not yet been fetched from Steam end end -- Attempt to fetch the friend's information now -- This might fail on app startup if not cached by the Steam client fetchFriendInfo() -- Called when info about one user has been received or changed local function onUserInfoUpdated( event ) if ( event.userSteamId == friendSteamId ) then fetchFriendInfo() end end -- Set up a listener to be invoked when user info has been received or changed steamworks.addEventListener( "userInfoUpdate", onUserInfoUpdated )