code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
getManifest(appID, depotID, manifestID, branchName, branchPassword, callback) { if (typeof manifestID == 'object' && typeof manifestID.gid == 'string') { // At some point, Valve changed the format of appinfo. // Previously, appinfo.depots[depotId].manifests.public would get you the public manifest ID. // Now...
Download a depot content manifest. @param {int} appID @param {int} depotID @param {string} manifestID @param {string} branchName - Now mandatory. Use 'public' for a the public build (i.e. not a beta) @param {string} [branchPassword] @param {function} [callback] @return Promise
getManifest
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
getRawManifest(appID, depotID, manifestID, branchName, branchPassword, callback) { if (typeof branchName == 'function') { callback = branchName; branchName = null; } if (typeof branchPassword == 'function') { callback = branchPassword; branchPassword = null; } return StdLib.Promises.callbackProm...
Download and decompress a manifest, but don't parse it into a JavaScript object. @param {int} appID @param {int} depotID @param {string} manifestID @param {string} branchName - Now mandatory. Use 'public' for a the public build (i.e. not a beta) @param {string} [branchPassword] @param {function} [callback]
getRawManifest
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
getManifestRequestCode(appID, depotID, manifestID, branchName, branchPassword, callback) { if (typeof branchPassword == 'function') { callback = branchPassword; branchPassword = null; } return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { this._sendUnified('Content...
Gets a manifest request code @param {int} appID @param {int} depotID @param {string} manifestID @param {string} branchName @param {string} [branchPassword] @param {function} [callback]
getManifestRequestCode
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
downloadChunk(appID, depotID, chunkSha1, contentServer, callback) { if (typeof contentServer === 'function') { callback = contentServer; contentServer = null; } chunkSha1 = chunkSha1.toLowerCase(); return StdLib.Promises.callbackPromise(['chunk'], callback, async (resolve, reject) => { if (!contentSe...
Download a chunk from a content server. @param {int} appID - The AppID to which this chunk belongs @param {int} depotID - The depot ID to which this chunk belongs @param {string} chunkSha1 - This chunk's SHA1 hash (aka its ID) @param {object} [contentServer] - If not provided, one will be chosen randomly. Should be an ...
downloadChunk
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
downloadFile(appID, depotID, fileManifest, outputFilePath, callback) { if (typeof outputFilePath === 'function') { callback = outputFilePath; outputFilePath = null; } return StdLib.Promises.callbackPromise(null, callback, async (resolve, reject) => { if (fileManifest.flags & EDepotFileFlag.Directory) { ...
Download a specific file from a depot. @param {int} appID - The AppID which owns the file you want @param {int} depotID - The depot ID which contains the file you want @param {object} fileManifest - An object from the "files" array of a downloaded and parsed manifest @param {string} [outputFilePath] - If provided, down...
downloadFile
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
function assignServer(idx) { servers[idx] = availableServers.splice(Math.floor(Math.random() * availableServers.length), 1)[0]; }
Download a specific file from a depot. @param {int} appID - The AppID which owns the file you want @param {int} depotID - The depot ID which contains the file you want @param {object} fileManifest - An object from the "files" array of a downloaded and parsed manifest @param {string} [outputFilePath] - If provided, down...
assignServer
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
function incrementCurrentServerIdx() { if (++currentServerIdx >= servers.length) { currentServerIdx = 0; } }
Download a specific file from a depot. @param {int} appID - The AppID which owns the file you want @param {int} depotID - The depot ID which contains the file you want @param {object} fileManifest - An object from the "files" array of a downloaded and parsed manifest @param {string} [outputFilePath] - If provided, down...
incrementCurrentServerIdx
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
getAppBetaDecryptionKeys(appID, password, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, ['keys'], callback, (resolve, reject) => { this._send(EMsg.ClientCheckAppBetaPassword, { app_id: appID, betapassword: password }, (body) => { if (body.eresult != EResult.OK) { return rejec...
Request decryption keys for a beta branch of an app from its beta password. @param {int} appID @param {string} password @param {function} [callback] - First arg is Error|null, second is an object mapping branch names to their decryption keys @return Promise
getAppBetaDecryptionKeys
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
function download(url, hostHeader, destinationFilename, callback) { if (typeof destinationFilename === 'function') { callback = destinationFilename; destinationFilename = null; } let timeout = null; let ended = false; let resetTimeout = () => { clearTimeout(timeout); timeout = setTimeout(() => { if (en...
Request decryption keys for a beta branch of an app from its beta password. @param {int} appID @param {string} password @param {function} [callback] - First arg is Error|null, second is an object mapping branch names to their decryption keys @return Promise
download
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
resetTimeout = () => { clearTimeout(timeout); timeout = setTimeout(() => { if (ended) { return; } ended = true; callback(new Error('Request timed out')); }, 10000); }
Request decryption keys for a beta branch of an app from its beta password. @param {int} appID @param {string} password @param {function} [callback] - First arg is Error|null, second is an object mapping branch names to their decryption keys @return Promise
resetTimeout
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
resetTimeout = () => { clearTimeout(timeout); timeout = setTimeout(() => { if (ended) { return; } ended = true; callback(new Error('Request timed out')); }, 10000); }
Request decryption keys for a beta branch of an app from its beta password. @param {int} appID @param {string} password @param {function} [callback] - First arg is Error|null, second is an object mapping branch names to their decryption keys @return Promise
resetTimeout
javascript
DoctorMcKay/node-steam-user
components/cdn.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/cdn.js
MIT
chatMessage(recipient, message, type) { recipient = Helpers.steamID(recipient); type = type || EChatEntryType.ChatMsg; if ([SteamID.Type.CLAN, SteamID.Type.CHAT].indexOf(recipient.type) != -1) { // It's a chat message let msg = ByteBuffer.allocate(8 + 8 + 4 + Buffer.byteLength(message) + 1, ByteBuffer.LIT...
Sends a chat message to a user or a chat room. @param {(SteamID|string)} recipient - The recipient user/chat, as a SteamID object or a string which can parse into one. To send to a group chat, use the group's (clan's) SteamID. @param {string} message - The message to send. @param {EChatEntryType} [type=ChatMsg] - Optio...
chatMessage
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
chatMsg(recipient, message, type) { return this.chatMessage(recipient, message, type); }
Sends a chat message to a user or a chat room. @param {(SteamID|string)} recipient - The recipient user/chat, as a SteamID object or a string which can parse into one. To send to a group chat, use the group's (clan's) SteamID. @param {string} message - The message to send. @param {EChatEntryType} [type=ChatMsg] - Optio...
chatMsg
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
chatTyping(recipient) { this.chatMessage(recipient, '', EChatEntryType.Typing); }
Tell another user that you're typing a message. @param {SteamID|string} recipient - The recipient, as a SteamID object or a string which can parse into one. @deprecated Use SteamUser.chat.sendFriendTyping instead
chatTyping
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
getChatHistory(steamID, callback) { return StdLib.Promises.callbackPromise(['messages'], callback, true, (resolve, reject) => { steamID = Helpers.steamID(steamID); let sid64 = steamID.getSteamID64(); this._send(EMsg.ClientFSGetFriendMessageHistory, { steamid: sid64 }); /** * Simply binds a li...
Requests chat history from Steam with a particular user. Also gets unread offline messages. @param {(SteamID|string)} steamID - The SteamID of the other user with whom you're requesting history (as a SteamID object or a string which can parse into one) @param {SteamUser~getChatHistoryCallback} [callback] - An optional ...
getChatHistory
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
joinChat(steamID, callback) { return StdLib.Promises.callbackPromise([], callback, true, (resolve, reject) => { let msg = ByteBuffer.allocate(9, ByteBuffer.LITTLE_ENDIAN); msg.writeUint64(toChatID(steamID).getSteamID64()); // steamIdChat msg.writeUint8(0); // isVoiceSpeaker this._send(EMsg.ClientJoinChat,...
Join a chat room. To join a group chat, use the group's (clan) SteamID. @param {(SteamID|string)} steamID - The SteamID of the chat to join (as a SteamID object or a string which can parse into one) @param {SteamUser~genericEResultCallback} [callback] - An optional callback to be invoked when the room is joined (or a f...
joinChat
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
leaveChat(steamID) { let msg = ByteBuffer.allocate(32, ByteBuffer.LITTLE_ENDIAN); msg.writeUint64(toChatID(steamID).getSteamID64()); // steamIdChat msg.writeUint32(EChatInfoType.StateChange); // type msg.writeUint64(this.steamID.getSteamID64()); msg.writeUint32(EChatMemberStateChange.Left); msg.writeUint64(...
Leave a chat room. @param {(SteamID|string)} steamID - The SteamID of the chat room to leave (as a SteamID object or a string which can parse into one) @deprecated This uses the old-style chat rooms, if you want new chat instead use this.chat
leaveChat
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
setChatPrivate(steamID) { let msg = ByteBuffer.allocate(20, ByteBuffer.LITTLE_ENDIAN); msg.writeUint64(toChatID(steamID).getSteamID64()); // steamIdChat msg.writeUint64(toChatID(steamID).getSteamID64()); // steamIdUserToActOn msg.writeUint32(EChatAction.LockChat); this._send(EMsg.ClientChatAction, msg.flip())...
Sets a chat room private (invitation required to join, unless a member of the group [if the chat is a Steam group chat]) @param {(SteamID|string)} steamID - The SteamID of the chat room to make private (as a SteamID object or a string which can parse into one) @deprecated This uses the old-style chat rooms, if you want...
setChatPrivate
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
setChatPublic(steamID) { let msg = ByteBuffer.allocate(20, ByteBuffer.LITTLE_ENDIAN); msg.writeUint64(toChatID(steamID).getSteamID64()); // steamIdChat msg.writeUint64(toChatID(steamID).getSteamID64()); // steamIdUserToActOn msg.writeUint32(EChatAction.UnlockChat); this._send(EMsg.ClientChatAction, msg.flip()...
Sets a chat room public (no invitation required to join) @param {(SteamID|string)} steamID - The SteamID of the chat room to make public (as a SteamID object or a string which can parse into one) @deprecated This uses the old-style chat rooms, if you want new chat instead use this.chat
setChatPublic
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
setChatOfficersOnly(steamID) { let msg = ByteBuffer.allocate(20, ByteBuffer.LITTLE_ENDIAN); msg.writeUint64(toChatID(steamID).getSteamID64()); // steamIdChat msg.writeUint64(toChatID(steamID).getSteamID64()); // steamIdUserToActOn msg.writeUint32(EChatAction.SetModerated); this._send(EMsg.ClientChatAction, ms...
Sets a group chat room to officers-only chat mode. @param {(SteamID|string)} steamID - The SteamID of the clan chat room to make officers-only (as a SteamID object or a string which can parse into one) @deprecated This uses the old-style chat rooms, if you want new chat instead use this.chat
setChatOfficersOnly
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
unsetChatOfficersOnly(steamID) { let msg = ByteBuffer.allocate(20, ByteBuffer.LITTLE_ENDIAN); msg.writeUint64(toChatID(steamID).getSteamID64()); // steamIdChat msg.writeUint64(toChatID(steamID).getSteamID64()); // steamIdUserToActOn msg.writeUint32(EChatAction.SetUnmoderated); this._send(EMsg.ClientChatAction...
Sets a group chat room out of officers-only chat mode, so that everyone can chat. @param {(SteamID|string)} steamID - The SteamID of the clan chat room to make open (as a SteamID object or a string which can parse into one) @deprecated This uses the old-style chat rooms, if you want new chat instead use this.chat
unsetChatOfficersOnly
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
kickFromChat(chatID, userID) { userID = Helpers.steamID(userID); let msg = ByteBuffer.allocate(20, ByteBuffer.LITTLE_ENDIAN); msg.writeUint64(toChatID(chatID).getSteamID64()); // steamIdChat msg.writeUint64(userID.getSteamID64()); // steamIdUserToActOn msg.writeUint32(EChatAction.Kick); this._send(EMsg.Cli...
Kicks a user from a chat room. @param {(SteamID|string)} chatID - The SteamID of the chat room to kick the user from (as a SteamID object or a string which can parse into one) @param {(SteamID|string)} userID - The SteamID of the user to kick from the room (as a SteamID object or a string which can parse into one) @dep...
kickFromChat
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
banFromChat(chatID, userID) { userID = Helpers.steamID(userID); let msg = ByteBuffer.allocate(20, ByteBuffer.LITTLE_ENDIAN); msg.writeUint64(toChatID(chatID).getSteamID64()); // steamIdChat msg.writeUint64(userID.getSteamID64()); // steamIdUserToActOn msg.writeUint32(EChatAction.Ban); this._send(EMsg.Clien...
Bans a user from a chat room. @param {(SteamID|string)} chatID - The SteamID of the chat room to ban the user from (as a SteamID object or a string which can parse into one) @param {(SteamID|string)} userID - The SteamID of the user to ban from the room (as a SteamID object or a string which can parse into one) @deprec...
banFromChat
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
unbanFromChat(chatID, userID) { userID = Helpers.steamID(userID); let msg = ByteBuffer.allocate(20, ByteBuffer.LITTLE_ENDIAN); msg.writeUint64(toChatID(chatID).getSteamID64()); // steamIdChat msg.writeUint64(userID.getSteamID64()); // steamIdUserToActOn msg.writeUint32(EChatAction.UnBan); this._send(EMsg.C...
Unbans a user from a chat room. @param {(SteamID|string)} chatID - The SteamID of the chat room to unban the user from (as a SteamID object or a string which can parse into one) @param {(SteamID|string)} userID - The SteamID of the user to unban from the room (as a SteamID object or a string which can parse into one) @...
unbanFromChat
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
inviteToChat(chatID, userID) { userID = Helpers.steamID(userID); this._send(EMsg.ClientChatInvite, { steam_id_invited: userID.getSteamID64(), steam_id_chat: toChatID(chatID).getSteamID64() }); }
Invites a user to a chat room. @param {(SteamID|string)} chatID - The SteamID of the chat room to invite the user to (as a SteamID object or a string which can parse into one) @param {(SteamID|string)} userID - The SteamID of the user to invite (as a SteamID object or a string which can parse into one) @deprecated This...
inviteToChat
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
createChatRoom(convertUserID, inviteUserID, callback) { return StdLib.Promises.callbackPromise(['chatID'], callback, true, (resolve, reject) => { convertUserID = convertUserID || new SteamID(); inviteUserID = inviteUserID || new SteamID(); let msg = ByteBuffer.allocate(53, ByteBuffer.LITTLE_ENDIAN); msg....
Creates a new multi-user chat room @param {null|SteamID|string} [convertUserID=null] - If the user with the SteamID passed here has a chat window open with us, their window will be converted to the new chat room and they'll join it automatically. If they don't have a window open, they'll get an invite. @param {null|Ste...
createChatRoom
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
function toChatID(steamID) { steamID = Helpers.steamID(steamID); if (steamID.type == SteamID.Type.CLAN) { steamID.type = SteamID.Type.CHAT; steamID.instance |= SteamID.ChatInstanceFlags.Clan; } return steamID; }
If steamID is a clan ID, converts to the appropriate chat ID. Otherwise, returns it untouched. @param {SteamID} steamID @returns SteamID
toChatID
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
function fromChatID(steamID) { steamID = Helpers.steamID(steamID); if (steamID.isGroupChat()) { steamID.type = SteamID.Type.CLAN; steamID.instance &= ~SteamID.ChatInstanceFlags.Clan; } return steamID; }
If steamID is a clan chat ID, converts to the appropriate clan ID. Otherwise, returns it untouched. @param {SteamID} steamID @returns SteamID
fromChatID
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
function decomposeChatFlags(chat, chatFlags) { chat.private = !!(chatFlags & EChatFlags.Locked); chat.invisibleToFriends = !!(chatFlags & EChatFlags.InvisibleToFriends); chat.officersOnlyChat = !!(chatFlags & EChatFlags.Moderated); chat.unjoinable = !!(chatFlags & EChatFlags.Unjoinable); }
Converts chat flags into properties on a chat room object @param {Object} chat @param {number} chatFlags
decomposeChatFlags
javascript
DoctorMcKay/node-steam-user
components/chat.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chat.js
MIT
saveGroup(groupId, name, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { this.user._sendUnified('ChatRoom.SaveChatRoomGroup#1', { chat_group_id: groupId, name }, (body, hdr) => { let err = Helpers.eresultError(hdr.proto); if (err) { ...
Saves an unnamed "ad-hoc" group chat and converts it into a full-fledged chat room group. @param {int} groupId @param {string} name @param {function} [callback] @returns {Promise}
saveGroup
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
getGroups(callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { this.user._sendUnified('ChatRoom.GetMyChatRoomGroups#1', {}, (body, hdr) => { let err = Helpers.eresultError(hdr.proto); if (err) { return reject(err); } body.chat_room_groups = b...
Get a list of the chat room groups you're in. @param {function} [callback] @returns {Promise<{chat_room_groups: Object<string, {group_summary: ChatRoomGroupSummary, group_state: UserChatRoomGroupState}>}>}
getGroups
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
setSessionActiveGroups(groupIDs, callback) { if (!Array.isArray(groupIDs)) { groupIDs = [groupIDs]; } return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { this.user._sendUnified('ChatRoom.SetSessionActiveChatRoomGroups#1', { chat_group_ids: groupIDs, chat_grou...
Set which groups are actively being chatted in by this session. Only active group chats will receive some events, like {@link SteamChatRoomClient#event:chatRoomGroupMemberStateChange} @param {int[]|string[]|int|string} groupIDs - Array of group IDs you want data for @param {function} [callback] @returns {Promise<{chat_...
setSessionActiveGroups
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
getInviteLinkInfo(linkUrl, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { let match = linkUrl.match(/^https?:\/\/s\.team\/chat\/([^/]+)$/); if (!match) { return reject(new Error('Invalid invite link')); } this.user._sendUnified('ChatRoom.GetInv...
Get details from a chat group invite link. @param {string} linkUrl @param {function} [callback] @returns {Promise<{invite_code: string, steamid_sender: SteamID, time_expires: Date|null, group_summary: ChatRoomGroupSummary, time_kick_expire: Date|null, banned: boolean}>}
getInviteLinkInfo
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
getClanChatGroupInfo(clanSteamID, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { clanSteamID = Helpers.steamID(clanSteamID); if (clanSteamID.type != SteamID.Type.CLAN) { return reject(new Error('SteamID is not for a clan')); } // just set these...
Get the chat room group info for a clan (Steam group). Allows you to join a group chat. @param {SteamID|string} clanSteamID - The group's SteamID or a string that can parse into one @param {function} [callback] @returns {Promise<{chat_group_summary: ChatRoomGroupSummary}>}
getClanChatGroupInfo
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
joinGroup(groupId, inviteCode, callback) { if (typeof inviteCode === 'function') { callback = inviteCode; inviteCode = undefined; } return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { this.user._sendUnified('ChatRoom.JoinChatRoomGroup#1', { chat_group_id: grou...
Join a chat room group. @param {int|string} groupId - The group's ID @param {string} [inviteCode] - An invite code to join this chat. Not necessary for public Steam groups. @param {function} [callback] @returns {Promise<{state: ChatRoomGroupState, user_chat_state: UserChatRoomGroupState}>}
joinGroup
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
leaveGroup(groupId, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { this.user._sendUnified('ChatRoom.LeaveChatRoomGroup#1', { chat_group_id: groupId }, (body, hdr) => { let err = Helpers.eresultError(hdr.proto); if (err) { return rej...
Leave a chat room group @param {int} groupId @param {function} [callback] @returns {Promise}
leaveGroup
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
inviteUserToGroup(groupId, steamId, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { this.user._sendUnified('ChatRoom.InviteFriendToChatRoomGroup#1', { chat_group_id: groupId, steamid: Helpers.steamID(steamId).toString() }, (body, hdr) => { ...
Invite a friend to a chat room group. @param {int} groupId @param {SteamID|string} steamId @param {function} [callback] @returns {Promise}
inviteUserToGroup
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
createInviteLink(groupId, options, callback) { if (typeof options == 'function') { callback = options; options = {}; } options = options || {}; return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { this.user._sendUnified('ChatRoom.CreateInviteLink#1', { chat_...
Create an invite link for a given chat group. @param {int} groupId @param {{secondsValid?: int, voiceChatId?: int}} [options] @param {function} [callback] @returns {Promise<{invite_code: string, invite_url: string, seconds_valid: number}>}
createInviteLink
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
getGroupInviteLinks(groupId, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { this.user._sendUnified('ChatRoom.GetInviteLinksForGroup#1', { chat_group_id: groupId }, (body, hdr) => { let err = Helpers.eresultError(hdr.proto); if (err) { ret...
Get all active invite links for a given chat group. @param {int} groupId @param {function} [callback] @returns {Promise<{invite_links: {invite_code: string, invite_url: string, steamid_creator: SteamID, time_expires: Date|null, chat_id: string}[]}>}
getGroupInviteLinks
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
deleteInviteLink(linkUrl, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, async (resolve, reject) => { let details = await this.getInviteLinkInfo(linkUrl); this.user._sendUnified('ChatRoom.DeleteInviteLink#1', { chat_group_id: details.group_summary.chat_group_id, ...
Revoke and delete an active invite link. @param {string} linkUrl @param {function} [callback] @returns {Promise}
deleteInviteLink
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
sendFriendMessage(steamId, message, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } else if (!options) { options = {}; } if (!options.chatEntryType) { options.chatEntryType = EChatEntryType.ChatMsg; } if (options.chatEntryType && typeof options.con...
Send a direct chat message to a friend. @param {SteamID|string} steamId @param {string} message @param {{[chatEntryType], [containsBbCode]}} [options] @param {function} [callback] @returns {Promise<{modified_message: string, server_timestamp: Date, ordinal: number}>}
sendFriendMessage
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
sendFriendTyping(steamId, callback) { return this.sendFriendMessage(steamId, '', {chatEntryType: EChatEntryType.Typing}, callback); }
Inform a friend that you're typing a message to them. @param {SteamID|string} steamId @param {function} [callback] @returns {Promise}
sendFriendTyping
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
sendChatMessage(groupId, chatId, message, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { this.user._sendUnified('ChatRoom.SendChatMessage#1', { chat_group_id: groupId, chat_id: chatId, message }, (body, hdr) => { let err = Helpers.eresultE...
Send a message to a chat room. @param {int|string} groupId @param {int|string} chatId @param {string} message @param {function} [callback] @returns {Promise<{modified_message: string, server_timestamp: Date, ordinal: number}>}
sendChatMessage
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
getActiveFriendMessageSessions(options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options = options || {}; return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { let lastmessage_since = options.conversationsSince ? conver...
Get a list of which friends we have "active" (recent) message sessions with. @param {{conversationsSince?: Date|int}} [options] @param {function} [callback] @returns {Promise<{sessions: {steamid_friend: SteamID, time_last_message: Date, time_last_view: Date, unread_message_count: int}[], timestamp: Date}>}
getActiveFriendMessageSessions
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
getFriendMessageHistory(friendSteamId, options, callback) { if (typeof options == 'function') { callback = options; options = {}; } options = options || {}; return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, async (resolve, reject) => { let steamid2 = Helpers.steamID(friendSteamId)....
Get your chat message history with a Steam friend. @param {SteamID|string} friendSteamId @param {{maxCount?: int, wantBbcode?: boolean, startTime?: Date|int, startOrdinal?: int, lastTime?: Date|int, lastOrdinal?: int}} [options] @param {function} [callback] @returns {Promise<{messages: {sender: SteamID, server_timestam...
getFriendMessageHistory
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
getChatMessageHistory(groupId, chatId, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { let max_count = options.maxCount || 100; let last_time = options.lastTime ? ...
Get message history for a chat (channel). @param {int|string} groupId @param {int|string} chatId @param {{[maxCount], [lastTime], [lastOrdinal], [startTime], [startOrdinal]}} [options] @param {function} [callback] @returns {Promise<{messages: {sender: SteamID, server_timestamp: Date, ordinal: number, message: string, s...
getChatMessageHistory
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
ackFriendMessage(friendSteamId, timestamp) { this.user._sendUnified('FriendMessages.AckMessage#1', { steamid_partner: Helpers.steamID(friendSteamId).toString(), timestamp: convertDateToUnix(timestamp) }); }
Acknowledge (mark as read) a friend message @param {SteamID|string} friendSteamId - The SteamID of the friend whose message(s) you want to acknowledge @param {Date|int} timestamp - The timestamp of the newest message you're acknowledging (will ack all older messages)
ackFriendMessage
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
ackChatMessage(chatGroupId, chatId, timestamp) { this.user._sendUnified('ChatRoom.AckChatMessage#1', { chat_group_id: chatGroupId, chat_id: chatId, timestamp: convertDateToUnix(timestamp) }); }
Acknowledge (mark as read) a chat room. @param {int} chatGroupId @param {int} chatId @param {Date|int} timestamp - The timestamp of the newest message you're acknowledging (will ack all older messages)
ackChatMessage
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
deleteChatMessages(groupId, chatId, messages, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { if (!Array.isArray(messages)) { return reject(new Error('The \'messages\' argument must be an array')); } for (let i = 0; i < messages.length; i++) ...
Delete one or more messages from a chat channel. @param {int|string} groupId @param {int|string} chatId @param {{server_timestamp, ordinal}[]} messages @param {function} [callback] @returns {Promise}
deleteChatMessages
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
createChatRoom(groupId, name, options, callback) { if (typeof options == 'function') { callback = options; options = {}; } options = options || {}; return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { this.user._sendUnified('ChatRoom.CreateChatRoom#1', { ...
Create a text/voice chat room in a group, provided you have permissions to do so. @param {int|string} groupId - The ID of the group in which you want to create the channel @param {string} name - The name of your new channel @param {{isVoiceRoom?: boolean}} [options] - Options for your new room @param {function} [callba...
createChatRoom
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
renameChatRoom(groupId, chatId, newChatRoomName, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { this.user._sendUnified('ChatRoom.RenameChatRoom#1', { chat_group_id: groupId, chat_id: chatId, name: newChatRoomName }, (body, hdr) => { ...
Rename a text/voice chat room in a group, provided you have permissions to do so. @param {int|string} groupId - The ID of the group in which you want to rename the room @param {int|string} chatId - The ID of the chat room you want to rename @param {string} newChatRoomName - The new name for the room @param {function} [...
renameChatRoom
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
deleteChatRoom(groupId, chatId, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { this.user._sendUnified('ChatRoom.DeleteChatRoom#1', { chat_group_id: groupId, chat_id: chatId }, (body, hdr) => { let err = Helpers.eresultError(hdr.proto); ...
Delete a text/voice chat room in a group (and all the messages it contains), provided you have permissions to do so. @param {int|string} groupId - The ID of the group in which you want to delete a room @param {int|string} chatId - The ID of the room you want to delete @param {function} [callback] @returns {Promise}
deleteChatRoom
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
getGroupBanList(groupId, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, false, (resolve, reject) => { this.user._sendUnified('ChatRoom.GetBanList#1', { chat_group_id: groupId }, (body, hdr) => { let err = Helpers.eresultError(hdr.proto); if (err) { return rejec...
Get the ban list for a chat room group, provided you have the appropriate permissions. @param {int|string} groupId @param {function} [callback] @returns {Promise<{bans: {steamid: SteamID, steamid_actor: SteamID, time_banned: Date, ban_reason: string}[]}>}
getGroupBanList
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
setGroupUserBanState(groupId, userSteamId, banState, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { this.user._sendUnified('ChatRoom.SetUserBanState#1', { chat_group_id: groupId, steamid: Helpers.steamID(userSteamId).toString(), ban_state: ...
Ban or unban a user from a chat room group, provided you have the appropriate permissions. @param {int|string} groupId @param {string|SteamID} userSteamId @param {boolean} banState - True to ban, false to unban @param {function} [callback] @returns {Promise}
setGroupUserBanState
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
setGroupUserRoleState(groupId, userSteamId, roleId, roleState, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { this.user._sendUnified(roleState ? 'ChatRoom.AddRoleToUser#1' : 'ChatRoom.DeleteRoleFromUser#1', { chat_group_id: groupId, role_id: ro...
Add or remove a role to a group user, provided you have the appropriate permissions. @param {int} groupId @param {SteamID|string} userSteamId @param {int} roleId @param {boolean} roleState @param {function} [callback] @returns {Promise}
setGroupUserRoleState
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function processChatRoomSummaryPair(summaryPair, preProcessed) { if (!preProcessed) { summaryPair = preProcessObject(summaryPair); } summaryPair.group_state = processUserChatGroupState(summaryPair.user_chat_group_state, true); summaryPair.group_summary = processChatGroupSummary(summaryPair.group_summary, true); ...
Process a chat room summary pair. @param {object} summaryPair @param {boolean} [preProcessed=false] @returns {{group_state: ChatRoomGroupState, group_summary: ChatRoomGroupSummary}}
processChatRoomSummaryPair
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function processChatGroupSummary(groupSummary, preProcessed) { if (groupSummary === null) { return groupSummary; } if (!preProcessed) { groupSummary = preProcessObject(groupSummary); } if (groupSummary.top_members) { groupSummary.top_members = groupSummary.top_members.map(accountid => SteamID.fromIndividua...
Process a chat group summary. @param {object} groupSummary @param {boolean} [preProcessed=false] @returns {ChatRoomGroupSummary}
processChatGroupSummary
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function processChatGroupState(state, preProcessed) { if (state === null) { return state; } if (!preProcessed) { state = preProcessObject(state); } state.chat_rooms = (state.chat_rooms || []).map(v => processChatRoomState(v, true)); return state; }
@param {object} state @param {boolean} [preProcessed=false] @returns {ChatRoomGroupState}
processChatGroupState
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function processUserChatGroupState(state, preProcessed) { if (!preProcessed) { state = preProcessObject(state); } state.user_chat_room_state = processUserChatRoomState(state.user_chat_room_state, true); state.unread_indicator_muted = !!state.unread_indicator_muted; return state; }
@param {object} state @param {boolean} [preProcessed=false] @returns {UserChatRoomGroupState}
processUserChatGroupState
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function processUserChatRoomState(state, preProcessed) { if (!preProcessed) { state = preProcessObject(state); } state.unread_indicator_muted = !!state.unread_indicator_muted; return state; }
@param {object} state @param {boolean} [preProcessed=false] @returns {UserChatRoomState}
processUserChatRoomState
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function processChatRoomState(state, preProcessed) { if (!preProcessed) { state = preProcessObject(state); } state.voice_allowed = !!state.voice_allowed; state.members_in_voice = state.members_in_voice.map(m => SteamID.fromIndividualAccountID(m)); return state; }
@param {object} state @param {boolean} [preProcessed=false] @returns {object}
processChatRoomState
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function processChatMentions(mentions) { if (!mentions) { return mentions; } if (mentions.mention_accountids) { mentions.mention_steamids = mentions.mention_accountids.map(acctid => SteamID.fromIndividualAccountID(acctid)); delete mentions.mention_accountids; } return mentions; }
@param {object} mentions @returns {{mention_all: boolean, mention_here: boolean, mention_steamids: SteamID[]}}
processChatMentions
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function preProcessObject(obj) { for (let key in obj) { if (!Object.hasOwnProperty.call(obj, key)) { continue; } let val = obj[key]; if (key.match(/^steamid_/) && typeof val === 'string' && val != '0') { obj[key] = new SteamID(val.toString()); } else if (key == 'timestamp' || key.match(/^time_/) || ke...
Pre-process a generic chat object. @param {object} obj @returns {object}
preProcessObject
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function isDataObject(val) { return val !== null && typeof val === 'object' && (val.constructor.name == 'Object' || val.constructor.name == ''); }
Pre-process a generic chat object. @param {object} obj @returns {object}
isDataObject
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function convertDateToUnix(date) { if (date instanceof Date) { return Math.floor(date.getTime() / 1000); } else if (typeof date !== 'number') { throw new Error('Timestamp must be a Date object or a numeric Unix timestamp'); } else if (date > 1420088400000) { return Math.floor(date / 1000); } else { return d...
Pre-process a generic chat object. @param {object} obj @returns {object}
convertDateToUnix
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function parseBbCode(str) { if (typeof str != 'string') { // Don't try to process non-string values, e.g. null return str; } // Steam will put a backslash in front of a bracket for a BBCode tag that shouldn't be parsed as BBCode, but our // parser doesn't ignore those. Let's just replace "\\[" with some string...
@param {string} str @returns {(string|BBCodeNode)[]}
parseBbCode
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function processTagNode(node) { if (node.tag == 'url') { // we only need to post-process attributes in url tags for (let i in node.attrs) { if (node.attrs[i] == i) { // The URL argument gets parsed with the name as its value node.attrs.url = node.attrs[i]; delete node.attrs[i]; } } }...
@param {string} str @returns {(string|BBCodeNode)[]}
processTagNode
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
function collapseStrings(arr) { // Turn sequences of strings into single strings let strStart = null; let newContent = []; for (let i = 0; i < arr.length; i++) { if (typeof arr[i] === 'string') { arr[i] = arr[i].replace(new RegExp(replacement, 'g'), '['); // only put in the bracket without the backslash ...
@param {string} str @returns {(string|BBCodeNode)[]}
collapseStrings
javascript
DoctorMcKay/node-steam-user
components/chatroom.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/chatroom.js
MIT
getAssetClassInfo(language, appid, classes, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, ['descriptions'], callback, (resolve, reject) => { this._sendUnified('Econ.GetAssetClassInfo#1', {language, appid, classes}, (body) => { resolve({descriptions: body.descriptions}); }); }); }
Get the list of currently-available content servers. @param {string} language @param {int} appid @param {{classid: int, instanceid?: int}[]} classes @param {function} [callback] @returns {Promise}
getAssetClassInfo
javascript
DoctorMcKay/node-steam-user
components/econ.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/econ.js
MIT
getTradeURL(callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { this._sendUnified('Econ.GetTradeOfferAccessToken#1', {}, (body) => { resolve({ token: body.trade_offer_access_token, url: 'https://steamcommunity.com/tradeoffer/new/?partner=' + this.st...
Gets your account's trade URL. @param {function} [callback] @returns {Promise}
getTradeURL
javascript
DoctorMcKay/node-steam-user
components/econ.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/econ.js
MIT
changeTradeURL(callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { this._sendUnified('Econ.GetTradeOfferAccessToken#1', {generate_new_token: true}, (body) => { resolve({ token: body.trade_offer_access_token, url: 'https://steamcommunity.com/tradeoff...
Makes a new trade URL for your account. @param {function} [callback] @returns {Promise}
changeTradeURL
javascript
DoctorMcKay/node-steam-user
components/econ.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/econ.js
MIT
getEmoticonList(callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, (resolve, reject) => { this._sendUnified('Player.GetEmoticonList#1', {}, (body, hdr) => { let err = Helpers.eresultError(hdr.proto); if (err) { return reject(err); } let emoticons = {}; body.e...
Gets the list of emoticons your account can use. @param {function} [callback] @returns {Promise}
getEmoticonList
javascript
DoctorMcKay/node-steam-user
components/econ.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/econ.js
MIT
getOwnedProfileItems(options, callback) { if (typeof options == 'function') { callback = options; options = {}; } options = options || {}; return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, false, (resolve, reject) => { this._sendUnified('Player.GetProfileItemsOwned#1', {language: o...
Get a listing of profile items you own. @param {{language?: string}} [options] @param {function} [callback] @returns {Promise}
getOwnedProfileItems
javascript
DoctorMcKay/node-steam-user
components/econ.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/econ.js
MIT
getEquippedProfileItems(steamID, options, callback) { if (typeof options == 'function') { callback = options; options = {}; } options = options || {}; return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, false, (resolve, reject) => { steamID = Helpers.steamID(steamID); this._sendU...
Get a user's equipped profile items. @param {SteamID|string} steamID - Either a SteamID object or a string that can parse into one @param {{language?: string}} [options] @param {function} [callback] @returns {Promise}
getEquippedProfileItems
javascript
DoctorMcKay/node-steam-user
components/econ.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/econ.js
MIT
setProfileBackground(backgroundAssetID, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { this._sendUnified('Player.SetProfileBackground#1', {communityitemid: backgroundAssetID}, (body, hdr) => { let err = Helpers.eresultError(hdr.proto); if (err)...
Change your current profile background. @param {number|string} backgroundAssetID @param {function} [callback]
setProfileBackground
javascript
DoctorMcKay/node-steam-user
components/econ.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/econ.js
MIT
function processProfileItem(item) { if (!Object.keys(item).some(k => item[k] !== null)) { return null; } ['image_large', 'image_small', 'movie_webm', 'movie_mp4'].forEach((key) => { if (item[key]) { item[key] = 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/' + item[key]; } }); return item...
Change your current profile background. @param {number|string} backgroundAssetID @param {function} [callback]
processProfileItem
javascript
DoctorMcKay/node-steam-user
components/econ.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/econ.js
MIT
addAuthorizedBorrowers(borrowersSteamID, callback) { return StdLib.Promises.timeoutCallbackPromise(5000, null, callback, true, (resolve, reject) => { if (!Array.isArray(borrowersSteamID)) { borrowersSteamID = [borrowersSteamID]; } this._sendUnified('DeviceAuth.AddAuthorizedBorrowers#1', { steamid: t...
Add new borrowers. @param {SteamID[]|string[]|SteamID|string} borrowersSteamID @param {function} [callback] @returns {Promise}
addAuthorizedBorrowers
javascript
DoctorMcKay/node-steam-user
components/familysharing.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/familysharing.js
MIT
removeAuthorizedBorrowers(borrowersSteamID, callback) { return StdLib.Promises.timeoutCallbackPromise(5000, null, callback, true, (resolve, reject) => { if (!Array.isArray(borrowersSteamID)) { return reject(new Error('The \'borrowersSteamID\' argument must be an array')); } this._sendUnified('DeviceAuth...
Remove borrowers. @param {SteamID[]|string[]} borrowersSteamID @param {function} [callback] @returns {Promise}
removeAuthorizedBorrowers
javascript
DoctorMcKay/node-steam-user
components/familysharing.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/familysharing.js
MIT
getAuthorizedBorrowers(options, callback) { return StdLib.Promises.timeoutCallbackPromise(5000, null, callback, (resolve, reject) => { if (typeof options == 'function') { callback = options; } options = options || {}; this._sendUnified('DeviceAuth.GetAuthorizedBorrowers#1', { steamid: this.steam...
Retrieve a list of Steam accounts authorized to borrow your library. @param {{includeCanceled?: boolean, includePending?: boolean}} [options] @param {function} [callback] @returns {Promise}
getAuthorizedBorrowers
javascript
DoctorMcKay/node-steam-user
components/familysharing.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/familysharing.js
MIT
getAuthorizedSharingDevices(options, callback) { if (typeof options == 'function') { callback = options; options = {}; } options = options || {}; return StdLib.Promises.timeoutCallbackPromise(5000, null, callback, (resolve, reject) => { this._sendUnified('DeviceAuth.GetOwnAuthorizedDevices#1', { ...
Get a list of devices we have authorized. @param {{includeCanceled?: boolean}} [options] @param {function} [callback] @returns {Promise}
getAuthorizedSharingDevices
javascript
DoctorMcKay/node-steam-user
components/familysharing.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/familysharing.js
MIT
authorizeLocalSharingDevice(deviceName, callback) { return StdLib.Promises.timeoutCallbackPromise(5000, null, callback, true, (resolve, reject) => { if (!deviceName) { return reject(new Error('The \'deviceName\' argument is required.')); } this._send(EMsg.ClientAuthorizeLocalDeviceRequest, { device_...
Authorize local device for library sharing. @param {string} deviceName @param {function} [callback] @returns {Promise}
authorizeLocalSharingDevice
javascript
DoctorMcKay/node-steam-user
components/familysharing.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/familysharing.js
MIT
deauthorizeSharingDevice(deviceToken, callback) { return StdLib.Promises.timeoutCallbackPromise(5000, null, callback, true, (resolve, reject) => { if (typeof deviceToken == 'object' && typeof deviceToken.deviceToken == 'string') { deviceToken = deviceToken.deviceToken; } if (typeof deviceToken != 'strin...
Deauthorize a device from family sharing. @param {string|{deviceToken: string}} deviceToken @param {function} [callback]
deauthorizeSharingDevice
javascript
DoctorMcKay/node-steam-user
components/familysharing.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/familysharing.js
MIT
setPersona(state, name) { this._send(EMsg.ClientChangeStatus, { persona_state: state, player_name: name }); }
Set your persona online state and optionally name. @memberOf SteamUser @param {EPersonaState} state - Your new online state @param {string} [name] - Optional. Set a new profile name.
setPersona
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
setUIMode(mode) { this._send(EMsg.ClientCurrentUIMode, {uimode: mode}); }
Set your current UI mode (displays next to your Steam online status in friends) @param {EClientUIMode} mode - Your new UI mode
setUIMode
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
addFriend(steamID, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, ['personaName'], callback, true, (resolve, reject) => { this._send(EMsg.ClientAddFriend, {steamid_to_add: Helpers.steamID(steamID).getSteamID64()}, (body) => { if (body.eresult != EResult.OK) { return reject(Helpers.eresul...
Send (or accept) a friend invitiation. @param {(SteamID|string)} steamID - Either a SteamID object of the user to add, or a string which can parse into one. @param {function} [callback] - Optional. Called with `err` and `name` parameters on completion.
addFriend
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
removeFriend(steamID) { if (typeof steamID === 'string') { steamID = new SteamID(steamID); } this._send(EMsg.ClientRemoveFriend, {friendid: steamID.getSteamID64()}); }
Remove a friend from your friends list (or decline an invitiation) @param {(SteamID|string)} steamID - Either a SteamID object of the user to remove, or a string which can parse into one.
removeFriend
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
blockUser(steamID, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { if (typeof steamID === 'string') { steamID = new SteamID(steamID); } let buffer = ByteBuffer.allocate(17, ByteBuffer.LITTLE_ENDIAN); buffer.writeUint64(this.steamID.getStea...
Block all communication with a user. @param {(SteamID|string)} steamID - Either a SteamID object of the user to block, or a string which can parse into one. @param {SteamUser~genericEResultCallback} [callback] - Optional. Called with an `err` parameter on completion. @return {Promise}
blockUser
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
unblockUser(steamID, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { if (typeof steamID === 'string') { steamID = new SteamID(steamID); } let buffer = ByteBuffer.allocate(17, ByteBuffer.LITTLE_ENDIAN); buffer.writeUint64(this.steamID.getSt...
Unblock all communication with a user. @param {(SteamID|string)} steamID - Either a SteamID object of the user to unblock, or a string which can parse into one. @param {SteamUser~genericEResultCallback} [callback] - Optional. Called with an `err` parameter on completion. @return {Promise}
unblockUser
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
listQuickInviteLinks(callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, false, (resolve, reject) => { this._sendUnified('UserAccount.GetFriendInviteTokens#1', {}, (body, hdr) => { let err = Helpers.eresultError(hdr.proto); if (err) { return reject(err); } body.to...
Get a list of friend quick-invite links for your account. @param {function} [callback] @returns {Promise}
listQuickInviteLinks
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
revokeQuickInviteLink(linkOrToken, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { if (linkOrToken.includes('/')) { // It's a link let parts = linkOrToken.split('/'); parts = parts.filter(part => !!part); // remove any trailing slash lin...
Revoke an active quick-invite link. @param {string} linkOrToken - Either the full link, or just the token from the link @param {function} [callback] @returns {Promise}
revokeQuickInviteLink
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
getQuickInviteLinkSteamID(link) { let match = link.match(/^https?:\/\/s\.team\/p\/([^/]+)\/([^/]+)/); if (!match) { return null; } return Helpers.parseFriendCode(match[1]); }
Get the SteamID to whom a quick-invite link belongs. @param {string} link @returns {SteamID|null} - null if the link isn't well-formed
getQuickInviteLinkSteamID
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
checkQuickInviteLinkValidity(link, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, false, (resolve, reject) => { let match = link.match(/^https?:\/\/s\.team\/p\/([^/]+)\/([^/]+)/); if (!match) { return reject(new Error('Malformed quick-invite link')); } let steamID = ...
Check whether a given quick-invite link is valid. @param {string} link @param {function} [callback] @returns {Promise<{valid: boolean, steamid: SteamID, invite_duration?: int}>}
checkQuickInviteLinkValidity
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
redeemQuickInviteLink(link, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, null, callback, true, (resolve, reject) => { let match = link.match(/^https?:\/\/s\.team\/p\/([^/]+)\/([^/]+)/); if (!match) { return reject(new Error('Malformed quick-invite link')); } let steamID = Helpers....
Redeem a quick-invite link and add the sender to your friends list. @param {string} link @param {function} [callback] @returns {Promise}
redeemQuickInviteLink
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
getPersonas(steamids, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, ['personas'], callback, true, (resolve, reject) => { const Flags = EClientPersonaStateFlag; let flags = Flags.Status | Flags.PlayerName | Flags.QueryPort | Flags.SourceID | Flags.Presence | Flags.Metadata | Flags.LastSeen...
Requests information about one or more user profiles. @param {(SteamID[]|string[])} steamids - An array of SteamID objects or strings which can parse into them. @param {function} [callback] - Optional. Called with `err`, and an object whose keys are 64-bit SteamIDs as strings, and whose values are persona objects. @ret...
getPersonas
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
function receive(err, sid, user) { if (err) { return reject(err); } let sid64 = sid.getSteamID64(); output[sid64] = user; let index = ids.indexOf(sid64); if (index != -1) { ids.splice(index, 1); } if (ids.length === 0) { resolve({personas: output}); } }
Requests information about one or more user profiles. @param {(SteamID[]|string[])} steamids - An array of SteamID objects or strings which can parse into them. @param {function} [callback] - Optional. Called with `err`, and an object whose keys are 64-bit SteamIDs as strings, and whose values are persona objects. @ret...
receive
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
getSteamLevels(steamids, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, ['users'], callback, (resolve, reject) => { let accountids = steamids.map((steamID) => { if (typeof steamID === 'string') { return (new SteamID(steamID)).accountid; } else { return steamID.accountid; } ...
Gets the Steam Level of one or more Steam users. @param {(SteamID[]|string[])} steamids - An array of SteamID objects, or strings which can parse into one. @param {function} [callback] - Called on completion with `err`, and an object whose keys are 64-bit SteamIDs as strings, and whose values are Steam Level numbers. @...
getSteamLevels
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
getGameBadgeLevel(appid, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, ['steamLevel', 'regularBadgeLevel', 'foilBadgeLevel'], callback, (resolve, reject) => { this._sendUnified('Player.GetGameBadgeLevels#1', {appid}, (body) => { let regular = 0; let foil = 0; (body.badges || []).for...
Get the level of your game badge (and also your Steam level). @param {int} appid - AppID of game in question @param {function} [callback] @returns {Promise}
getGameBadgeLevel
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
inviteToGroup(userSteamID, groupSteamID) { let buffer = ByteBuffer.allocate(17, ByteBuffer.LITTLE_ENDIAN); buffer.writeUint64(Helpers.steamID(userSteamID).toString()); buffer.writeUint64(Helpers.steamID(groupSteamID).toString()); buffer.writeUint8(1); // unknown this._send(EMsg.ClientInviteUserToClan, buffer...
Invites a user to a Steam group. Only send group invites in response to a user's request; sending automated group invites is a violation of the Steam Subscriber Agreement and can get you banned. @param {(SteamID|string)} userSteamID - The SteamID of the user you're inviting as a SteamID object, or a string that can par...
inviteToGroup
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
respondToGroupInvite(groupSteamID, accept) { let buffer = ByteBuffer.allocate(9, ByteBuffer.LITTLE_ENDIAN); buffer.writeUint64(Helpers.steamID(groupSteamID).toString()); buffer.writeUint8(accept ? 1 : 0); this._send(EMsg.ClientAcknowledgeClanInvite, buffer.flip()); }
Respond to an incoming group invite. @param {(SteamID|string)} groupSteamID - The group you were invited to, as a SteamID object or a string which can parse into one @param {boolean} accept - true to join the group, false to ignore invitation
respondToGroupInvite
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT
createFriendsGroup(groupName, callback) { return StdLib.Promises.timeoutCallbackPromise(10000, ['groupID'], callback, true, (resolve, reject) => { this._send(EMsg.AMClientCreateFriendsGroup, { groupname: groupName }, (body) => { if (body.eresult != EResult.OK) { return reject(Helpers.eresultError(b...
Creates a friends group (or tag) @param {string} groupName - The name to create the friends group with @param {function} [callback] @return {Promise}
createFriendsGroup
javascript
DoctorMcKay/node-steam-user
components/friends.js
https://github.com/DoctorMcKay/node-steam-user/blob/master/components/friends.js
MIT