From 25c31eacadd8b892bc1c8b1fb2c84da49d548345 Mon Sep 17 00:00:00 2001 From: Alex Corn Date: Tue, 1 Sep 2020 06:29:45 -0400 Subject: [PATCH] Updated readme --- README.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 85e8d0b2..e7439ee5 100644 --- a/README.md +++ b/README.md @@ -240,7 +240,7 @@ Defaults to `Auto`. ### language Set this to the full name of a language (e.g. "english" or "spanish") to localize specific things within steam-user. -Currently this is only used to localize `rich_presence_string` in [`user`](#user) event data. +Currently this is only used to localize `rich_presence_string` in [`user`](#user) event data and in `requestRichPresence`. Added in 4.0.0. @@ -1068,11 +1068,37 @@ Requests localized rich presence strings for a particular app in the given langu ### requestRichPresence(appID, steamIDs, callback) - `appID` - The ID of the app for which you want to get rich presence data for - `steamIDs` - An array of SteamID objects or strings that can parse into SteamID objects +- `language` - Optional. A string containing a full language name (e.g. `'english'` or `'spanish'`). Defaults to language passed in constructor or `setOption` if omitted. - `callback` - Called when the requested data is available. - `err` - An `Error` object on failure, or `null` on success - - `users` - An object whose keys are 64-bit SteamIDs (as strings) and whose values are objects containing the received rich presence data. If no data was received for a SteamID there will be no key for that SteamID (and therefore no value). + - `response` - The response object + - `users` - An object whose keys are 64-bit SteamIDs (as strings) and whose values are objects containing the received rich presence data. If no data was received for a SteamID there will be no key for that SteamID (and therefore no value). + +**v4.18.0 or later is required to use this method** + +Requests rich presence key/value data and localized strings as displayed in Steam for a list of given users, for a given +app. Response object looks like this: + +```json +{ + "users": { + "76561198006409530": { + "richPresence": { + "status": "Playing CS:GO", + "version": "13765", + "time": "15.851017", + "game:state": "lobby", + "steam_display": "#display_Menu", + "connect": "+gcconnectG02C0193A" + }, + "localizedString": "Playing CS:GO" + } + } +} +``` -**v or later is required to use this method** +If the Steam display string cannot be localized, then `localizedString` will be null. This is the case when there exists +no translation for the language you selected. ### getSteamLevels(steamids, callback) - `steamids` - An array of `SteamID` objects or strings that can parse into `SteamID` objects