Skip to content

SteamChatRoomClient

Alex Corn edited this page Feb 19, 2022 · 27 revisions

Available as a chat property on every SteamUser instance, SteamChatRoomClient is how you can interact programmatically with "new Steam chat", including the new chat rooms.

Unlike most SteamUser methods and events, these are all only available from the SteamChatRoomClient via the chat property. For example:

let user = new SteamUser();
// log on the user

user.chat.sendFriendMessage("[U:1:46143802]", "Hello, world!");

Table of Contents

Concepts ^

Callbacks and Promises

All methods listed in this document that accept a callback also return a Promise. You may use either callbacks or promises.

All promises (which return any data at all) return a single object containing one or more properties. This object is the same as the object returned in the callback for that method, as documented here.

Some methods indicate that their callback is required or optional. You are never required to use callbacks over promises, but if a callback is listed as optional then an unhandled promise rejection will not raise a warning/error. If a callback is listed as required and you neither supply a callback nor handle the promise rejection, then a promise rejection will raise a warning, and eventually a crash in a future Node.js release.

Ordinal

Each message in new Steam chat has both a timestamp and an ordinal. The timestamp value should be self-explanatory, but the ordinal value is a 0-indexed counter that increments if a user sends multiple messages within the same second. This enables messages to be identified uniquely using only their timestamp and their ordinal.

Chat Rooms vs. Chat Room Groups vs. Steam Groups

All three of the above are distinctly separate things in Steam.

  • Chat Rooms - Internally, Steam calls chat channels "chat rooms". When you see the term "chat room", think "channel".
  • Chat Room Groups - Think "Discord server". This is a "group chat" on your friends list. Chat room groups are owned by one individual, and can have multiple text and voice channels.
  • Steam Groups - Steam groups have pretty much nothing to do with chat room groups/chat rooms, except that there's a button on a Steam group's overview page to join a chat room group which is linked to that Steam group. Internally though, Steam groups and chat room groups are entirely separate things, linked only by getClanChatGroupInfo(clanSteamID, callback) and by the clanid property in Chat Room Group Header State.

Parsed BBCode

As of v4.1.0, BBCode is automatically parsed in incoming chat messages and modified outgoing messages. The parsed BBCode is available as a message_bbcode_parsed property of relevant objects. That property contains an array. Each element in the array is either a string or an object with these properties:

  • tag - A string containing the name of this BBCode tag (e.g. url)
  • attrs - An object containing the BBCode tag's attributes (stuff that goes inside the brackets, e.g. [url=https://example.com])
  • content - An array of the same format as the root message_bbcode_parsed property

Examples

BBCode:

'Lorem ipsum dolor sit [emoticon]steamhappy[/emoticon] amet, consectetur adipiscing elit. Vivamus imperdiet.'

Parses into:

[
	"Lorem ipsum dolor sit ",
	{
		"tag": "emoticon",
		"attrs": {},
		"content": ["steamhappy"]
	},
	" amet, consectetur adipiscing elit. Vivamus imperdiet."
]

BBCode:

'[random min="1" max="1000" result="333"][/random]'

Parses into:

[
	{
		"tag": "random",
		"attrs": {
			"min": "1",
			"max": "1000",
			"result": "333"
		},
		"content": []
	}
]

BBCode:

'[img src="https://giphy.com/gifs/test-gw3IWyGkC0rsazTi" thumbnail_src="https://media0.giphy.com/media/gw3IWyGkC0rsazTi/giphy.gif" height="199" width="265" giphy_search="test" title="test GIF"][url=https://media0.giphy.com/media/gw3IWyGkC0rsazTi/giphy.gif]https://media0.giphy.com/media/gw3IWyGkC0rsazTi/giphy.gif[/url][/img]'

Parses into:

[
	{
		"tag": "img",
		"attrs": {
			"src": "https://giphy.com/gifs/test-gw3IWyGkC0rsazTi",
			"thumbnail_src": "https://media0.giphy.com/media/gw3IWyGkC0rsazTi/giphy.gif",
			"height": "199",
			"width": "265",
			"giphy_search": "test",
			"title": "test GIF"
		},
		"content": [
			{
				"tag": "url",
				"attrs": {"url": "https://media0.giphy.com/media/gw3IWyGkC0rsazTi/giphy.gif"},
				"content": ["https://media0.giphy.com/media/gw3IWyGkC0rsazTi/giphy.gif"]
			}
		]
	}
]

Mentioning a User

To mention a user in a chat room, use this BBCode: [mention=accountid]@name[/mention]

The accountid should be the accountid portion of the target user's SteamID. If you have a SteamID object, it's the accountid property. If you have a string like [U:1:46143802], the accountid is 46143802.

Standard Objects ^

"Standard objects" are objects that are reused across multiple methods and events in the SteamChatRoomClient.

Chat Room Group Summary

  • chat_rooms - An array of Chat Room State objects
  • top_members - An array of SteamID objects representing the group's "top members"
  • chat_group_id - The ID of this chat room group
  • chat_group_name - The name of this chat room group
  • active_member_count - An integer representing how many members are active
  • active_voice_member_count - An integer representing how many members are active in voice
  • default_chat_id - A string containing the numeric ID of the default chat room (channel) in this group
  • chat_group_tagline - The group's tagline
  • appid - If the chat group is linked to an app, this is its AppID. Otherwise, null.
  • steamid_owner - A SteamID object representing the group's owner
  • watching_broadcast_steamid - If the group is in a broadcast watch party, this is the SteamID of the broadcaster
  • chat_group_avatar_sha - If the group has an avatar set, this is its SHA-1 hash, as a Buffer. If not, null.
  • chat_group_avatar_url - If the group has an avatar set, this is the URL where you can download it. If not, null.

Chat Room Group State

User Chat Room Group State

  • chat_group_id - A string containing the numeric ID of the chat room group in question
  • time_joined - A Date object representing when you joined this group
  • user_chat_room_state - An array of User Chat Room State objects
  • desktop_notification_level - A value from EChatRoomNotificationLevel
  • mobile_notification_level - A value from EChatRoomNotificationLevel
  • time_last_group_ack - A Date object representing when you last acknowledged messages in this group. null if never.
  • unread_indicator_muted - true if you have muted the unread indicator for this group

User Chat Room State

  • chat_id - A string containing the numeric ID of the chat room in question
  • time_joined - A Date object representing when you joined this chat room
  • time_last_ack - A Date object representing when you last acknowledged messages in this chat room. null if never.
  • desktop_notification_level - A value from EChatRoomNotificationLevel
  • mobile_notification_level - A value from EChatRoomNotificationLevel
  • time_last_mention - A Date object representing when you were last mentioned in this chat room. null if never.
  • unread_indicator_muted - true if you have muted the unread indicator for this room
  • time_first_unread - A Date object representing the oldest un-acknowledged message in this room (added in v4.11.0)

Chat Room Group Header State

  • chat_group_id - The ID of this chat room group
  • chat_name - The name of this group
  • clanid - If this is a chat room group linked to a Steam group, this is the associated Steam group's SteamID object, or null if not linked to a group.
  • steamid_owner - A SteamID object representing the owner of this chat room group
  • appid - If the chat group is linked to an app, this is its AppID. Otherwise, null.
  • tagline - The group's tagline
  • avatar_sha - If the group has an avatar set, this is its SHA-1 hash, as a Buffer. If not, null.
  • avatar_url - If the group has an avatar set, this is the URL where you can download it. If not, null.
  • default_role_id - The ID of the default role applied to new members
  • roles - An array of Chat Role objects
  • role_actions - An array of Chat Role Actions objects
  • watching_broadcast_steamid - If the group is in a broadcast watch party, this is the SteamID of the broadcaster

Chat Room Member

  • steamid - The member's SteamID
  • state - A value from EChatRoomJoinState
  • rank - A value from EChatRoomGroupRank
  • time_kick_expire - A Date object of when this member's kick expires, or null if not kicked
  • role_ids - An array of this member's applied role IDs

Chat Room State

  • chat_id - A string containing this chat room (channel)'s numeric ID
  • chat_name - The name of this room (channel)
  • voice_allowed - true if voice is allowed in this room
  • members_in_voice - An array of SteamID objects for who's in this room's voice chat
  • time_last_message - A Date object representing when the last message was sent to this room
  • sort_order - An integer determining how this room is sorted within its chat group
  • last_message - A string containing the text of the last message sent to this room (added in v4.11.0)
  • steamid_last_message A SteamID object representing the sender of the last message sent to this room (added in v4.11.0)

Chat Role

  • role_id - A string containing this role's numeric ID
  • name - The name of this role
  • ordinal - An integer determining how this role is sorted within its chat group

Chat Role Actions

  • role_id - A string containing the associated role's numeric ID
  • can_create_rename_delete_channel - Boolean
  • can_kick - Boolean
  • can_ban - Boolean
  • can_invite - Boolean
  • can_change_tagline_avatar_name - Boolean
  • can_chat - Boolean
  • can_view_history - Boolean
  • can_change_group_roles - Boolean
  • can_change_user_roles - Boolean
  • can_mention_all - Boolean
  • can_set_watching_broadcast - Boolean

Incoming Friend Message

  • steamid_friend - A SteamID object
  • chat_entry_type - A value from EChatEntryType
  • from_limited_account - This is true if the message sender is a limited Steam account
  • message - The message text
  • message_no_bbcode - The message text without BBCode tags (if possible; may still contain BBCode for text that has no plaintext alternative, e.g. [flip])
  • message_bbcode_parsed - The chat message with BBCode parsed
  • server_timestamp - A Date object for this message's timestamp
  • ordinal - This message's ordinal
  • local_echo - This is true if this is a message you sent on another client that is being "echoed" to another client instance
  • low_priority - Boolean

Incoming Chat Message

  • chat_group_id - The ID of the chat room group this was sent to
  • chat_id - The ID of the chat room (channel) this was sent to
  • steamid_sender - A SteamID object
  • message - The message text
  • message_no_bbcode - The message text without BBCode tags (if possible; may still contain BBCode for text that has no plaintext alternative, e.g. [flip])
  • server_timestamp - A Date object for this message's timestamp
  • ordinal - This message's ordinal
  • mentions - A Chat Mentions object, or null
  • server_message - A Server Message object, or null
  • chat_name - A string containing the name of the chat room group this message was sent to

Chat Mentions

  • mention_all - Boolean
  • mention_here - Boolean
  • mention_steamids - An array of SteamID objects

Server Message

  • message - A value from EChatRoomServerMessage
  • string_param - An optional string parameter
  • steamid_param - An optional SteamID object

Methods ^

createGroup([inviteeSteamIDs, ][name, ]callback)

  • inviteeSteamIds - An array of users to invite to this new group, as SteamID objects or strings that can parse into SteamIDs
  • name - A name for this group. Pass an empty string '' to create an "ad-hoc" group chat (see below)
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object

v4.21.0 or later is required to use this method

Creates a new chat room group.

If you omit or pass an empty string for the name, this creates an "ad-hoc" group chat, the same as clicking the +Friend button in a standard one-to-one friend chat. Unnamed "ad-hoc" group chats are special groups that contain only a single text channel, and can be "saved" and converted into a full-fledged chat room group by any user in the group chat via giving it a name (see saveGroup). The user who initiated the group chat is the owner, but anyone can save the group, and they will then become the owner of the saved chat room group.

saveGroup(groupId, name[, callback])

  • groupId - The ID of the chat room group you want to save and convert into a full-fledged chat room group
  • name - The name for your new chat room group
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success

v4.21.0 or later is required to use this method

Converts an "ad-hoc" multi-user group chat into a full-fledged chat room group, which can contain multiple channels. Anyone in a group chat can save it, not just the owner of the group chat. Upon saving, you will become the owner of the saved chat room group.

joinGroup(groupId[, inviteCode], callback)

  • groupId - The chat group ID you want to join (group_summary.chat_group_id in getInviteLinkInfo response)
  • inviteCode - The invite code you were provided to join this group. Not necessary if you're joining the chat room for a Steam group you have access to, or if you were invited directly through Steam.
  • callback - Called when the request completes

Requests to join a chat room group. If the provided group ID or invite code are not valid, you will get an Error with message "Invalid group ID or invite code". If you are banned, you will get an Error with message "Banned".

leaveGroup(groupId[, callback])

  • groupId - The chat group ID you want to leave
  • callback - Optional. Called when the request completes
    • err - An Error object on failure, or null on success

v4.21.0 or later is required to use this method

Leaves a chat room group you have previously joined.

getGroups(callback)

  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object

Returns a list of all chat room groups you are a member of.

setSessionActiveGroups(groupIDs, callback)

  • groupIDs - An array of chat room group IDs
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object
      • chat_room_groups - An object where keys are numeric chat room group IDs and values are Chat Room Group State objects

v4.8.0 or later is required to use this method

Tells Steam which chat room groups you have open in your current client session. The official client sends this when a chat room group is opened or closed. Also returns Chat Room Group State data.

You will only get some events (like chatRoomGroupMemberStateChange) for groups that you have set as active.

getInviteLinkInfo(linkUrl, callback)

  • linkUrl - The full invite link URL for a group chat (e.g. https://s.team/chat/abcdefg)
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object
      • invite_code - The invite code from the link
      • steamid_sender - A SteamID object containing the ID of the person who created the invite link
      • time_expires - A Date object containing the time when this invite link expires. null if the link does not expire.
      • group_summary - A Chat Room Group Summary object
      • time_kick_expire - A Date object containing the time when your kick from this group will expire, or null if you aren't on a kick cooldown
      • banned - true if you are banned from this group

Gets details about a chat room group from an invite link. If the provided invite link is not valid, you will get an Error with message "Invalid invite link".

getClanChatGroupInfo(clanSteamID, callback)

  • clanSteamID - The group's SteamID or a string that can parse into one
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object

Get details about a clan (Steam group)'s chat room group. The returned summary includes the group's chat room group ID, which you can use with joinGroup to join that group chat. You do not need an invite code to join a Steam group chat that you have access to.

inviteUserToGroup(groupId, steamId[, callback])

  • groupId - The chat group ID you want to invite a friend to
  • steamId - Your friend's SteamID object, or a string that can parse into one
  • callback - Optional. Called when the request completes
    • err - An Error object on failure, or null on success

Invites a Steam friend to join a chat room group. You must have permission to do so.

createInviteLink(groupId[, options], callback)

  • groupId - The ID of the chat room group you want an invite link for
  • options - Optional. An object containing zero or more of the following properties:
    • secondsValid - The number of seconds for which this link should be valid. Use 0 to never expire this link. Steam will only accept the intervals that are available in the official Steam client (never, one hour, one day). Default one hour (3600).
    • voiceChatId - Provide the ID of a voice chat room here, and people who use this invite link will be automatically joined to that voice chat room.
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object
      • invite_code - The code from the invite link
      • invite_url - The full invite link URL
      • seconds_valid - The number of seconds for which this link is valid. null if it never expires.

v4.5.0 or later is required to use this method

Creates a new invite link for a chat room group, provided you have permission to do so.

getGroupInviteLinks(groupId, callback)

  • groupId - The ID of the chat room group in question
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object
      • invite_links - An array of objects
        • invite_code - The code from the invite link
        • invite_url - The full invite link URL
        • time_expires - A Date object for when this invite link expires, or null if it never expires
        • chat_id - The ID of the voice chat which people who use this invite link will auto-join. The official Steam client appears to fill in a text chat room ID here, but it appears to have no effect if the ID is a text chat.

v4.5.0 or later is required to use this method

Retrieves a list of all active invite links for a given chat room group, provided you have permission to do so.

deleteInviteLink(linkUrl, callback)

  • linkUrl - The full invite link URL you want to delete
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success

v4.5.0 or later is required to use this method

Revokes and deletes an invite link, provided you have permission to do so.

sendFriendMessage(steamId, message[, options][, callback])

  • steamId - The SteamID of your friend, as a SteamID object or a string that can parse into one
  • message - The string message you want to send
  • options - Optional. An object containing zero or more of these properties:
    • chatEntryType - A value from EChatEntryType. Defaults to ChatMsg.
    • containsBbCode - true to allow the Steam server to parse /commands (default true)
  • callback - Optional. Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object
      • modified_message - A string containing the message as it will be broadcast to the other user. If any /commands got parsed and turned into BBCode, you'll see that BBCode here.
      • server_timestamp - A Date object containing the timestamp the server gave to this message.
      • ordinal - This message's ordinal

Sends a chat message to a friend.

sendFriendTyping(steamId[, callback])

  • steamId - The SteamID of your friend, as a SteamID object or a string that can parse into one
  • callback - Optional. Called when the request completes
    • err - An Error object on failure, or null on success

Notifies a friend that you are typing a chat message to them.

sendChatMessage(groupId, chatId, message[, callback])

  • groupId - The ID of the chat room group you want to send this message to
  • chatId - The ID of the chat room (channel) you want to send this message to
  • message - Your actual message text
  • callback - Optional. Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object
      • modified_message - A string containing the message as it will be broadcast to the other user. If any /commands got parsed and turned into BBCode, you'll see that BBCode here.
      • server_timestamp - A Date object containing the timestamp the server gave to this message.
      • ordinal - This message's ordinal

Sends a chat message to a chat channel.

deleteChatMessages(groupId, chatId, messages[, callback])

  • groupId - The ID of the chat room group you want to delete a message from
  • chatId - The ID of the chat room (channel) you want to delete a message from
  • messages - An array of objects with these properties:
    • server_timestamp - Either a Date or a numeric Unix timestamp (you may also name this property timestamp)
    • ordinal - The ordinal of the message you want to delete. May be omitted if 0.
  • callback - Optional. Called when the request completes
    • err - An Error object on failure, or null on success

Deletes some messages from a chat room, provided you have access. Note that the message sender gets no indication that their message was deleted, but everyone else sees [MESSAGE DELETED].

createChatRoom(groupId, name[, options][, callback])

  • groupId - The ID of the group in which you want to create a room
  • name - The name for your new room
  • options - Optional. An object containing zero or more of these properties:
    • isVoiceRoom - true to make this a voice channel, false to make it a text channel. Default false.
  • callback - Optional. Called when the request completes.
    • err - An Error object on failure, or null on success
    • response - The response object

v4.12.0 or later is required to use this method

Creates a new room in a chat room group, provided you have access to do so.

renameChatRoom(groupId, chatId, newChatRoomName[, callback])

  • groupId - The ID of the chat room group in which you want to rename a room
  • chatId - The ID of the chat room you want to rename
  • newChatRoomName - The new name for your chat room
  • callback - Optional. Called when the request completes.
    • err - An Error object on failure, or null on success

v4.12.0 or later is required to use this method

Renames a chat room in a chat room group, provided you have access to do so.

deleteChatRoom(groupId, chatId[, callback])

  • groupId - The ID of the chat room group in which you want to delete a room
  • chatId - The ID of the chat room you want to delete
  • callback - Optional. Called when the request completes.
    • err - An Error object on failure, or null on success

v4.12.0 or later is required to use this method

Deletes a chat room in a chat room group, provided you have access to do so. All of the chat room's chat history will be permanently lost.

kickUserFromGroup(groupId, steamId[, expireTime][, callback])

  • groupId - The ID of the chat room group you want to kick someone from
  • steamId - The SteamID object for the user you want to kick, or a string that can parse into one
  • expireTime - A Date object or numeric Unix timestamp for when the user should be permitted to rejoin. Omit to allow them to rejoin immediately (provided they have an invite link)
  • callback - Optional. Called when the request completes
    • err - An Error object on failure, or null on success

Kicks a user from a chat room group, provided you have access to do so.

getGroupBanList(groupId, callback)

  • groupId - The ID of the chat room group you want to retrieve the ban list for
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object
      • bans - An array of objects representing the bans for the chat group. Each object has these properties:
        • steamid - A SteamID object for the user who was banned
        • steamid_actor - A SteamID object for the user who banned them
        • time_banned - A Date object for when the ban was issued
        • ban_reason - Seemingly always an empty string as the Steam UI doesn't support ban reasons

v4.10.0 or later is required to use this method

Retrieves the ban list for a chat room group, provided you have access to do so.

setGroupUserBanState(groupId, userSteamId, banState[, callback])

  • groupId - The ID of the chat room group you want to ban/unban someone from
  • userSteamId - The SteamID of the user who you want to ban or unban, as a SteamID object or a string that can parse into one
  • banState - true to ban the user, or false to unban them
  • callback - Optional. Called when the request completes
    • err - An Error object on failure, or null on success

v4.10.0 or later is required to use this method

Bans or unbans a user from a chat room group, provided you have access to do so.

setGroupUserRoleState(groupId, userSteamId, roleId, roleState[, callback])

  • groupId - The ID of the chat room group you want to manage someone's roles in
  • userSteamId - The SteamID of the user who you want to manage roles on, as a SteamID object or a string that can parse into one
  • roleId - The ID of the role you want to manage
  • roleState - true to add the role, or false to remove it
  • callback - Optional. Called when the request completes
    • err - An Error object on failure, or null on success

v4.21.0 or later is required to use this method

Adds or removes a role on a user in a chat room group, provided you have access to do so.

If you try to add a role that a user already has, you will get the error DuplicateRequest.
If you try to remove a role that a user doesn't have, you will get the error NoMatch.

getActiveFriendMessageSessions([options], callback)

  • options - Optional. An object containing zero or more of these properties:
    • conversationsSince - Either a Date object or a number containing a Unix timestamp. If passed, only sessions that have had a message sent since this time are returned.
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object
      • sessions - An array of objects representing active chat sessions, each of which contains these properties:
        • steamid_friend - The SteamID object for the friend
        • time_last_message - A Date object for the time when the last message was sent in this session
        • time_last_view - A Date object for the time when this session was last opened by you
        • unread_message_count - How many unread messages are contained in this session
      • timestamp - A Date object containing the current time. Pass this to conversationsSince if you want to poll for data.

v4.9.1 or later is required to use this method

Retrieves the list of your "active" (recent) friend chat sessions. In the official Steam client, these are the tabs that are auto-opened when you open a chat window.

getFriendMessageHistory(friendSteamId[, options], callback)

  • friendSteamId - Your friend's SteamID, as a SteamID object or a string that can parse into one
  • options - Optional. An object with zero or more of these properties:
    • maxCount - The maximum number of messages you want to retrieve. Default 100.
    • wantBbcode - Specify whether you want BBCode in the messages you retrieve. Default true.
    • startTime - A Date object or Unix timestamp for the oldest message you want to retrieve (note that messages are retrieved sorted newest to oldest, so this just limits how far back you can go). Default the beginning of time.
    • startOrdinal - The ordinal of the oldest message you want to retrieve. Default not specified.
    • lastTime - A Date object or Unix timestamp for the newest message you want to retrieve. Default the end of time.
    • lastOrdinal - The ordinal of the oldest message you want to retrieve. Default not specified.
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object
      • messages - An array of objects, each of which contains these properties:
        • sender - The SteamID object for the message sender
        • server_timestamp - A Date object for when this message was sent
        • ordinal - This message's ordinal
        • message - The message text
        • message_bbcode_parsed - If wantBbcode was true, this is the parsed BBCode for this message. null otherwise.
        • unread - true if this message was sent by the other user and you have not yet acknowledged it using ackFriendMessage
      • more_available - Boolean indicating whether there are more chat messages that you can retrieve

v4.5.0 or later is required to use this method
v4.9.1 or later is required to use the unread property

Retrieves recent chat messages with a Steam friend. Messages are returned sorted newest-to-oldest, so calling this without any options will return your 100 most recent messages with the given Steam friend.

getChatMessageHistory(groupId, chatId[, options], callback)

  • groupId - The ID of the chat room group you want history in
  • chatId - The ID of the chat room (channel) you want history in
  • options - Optional. An object containing zero or more of these properties
    • maxCount - The maximum number of messages to return. Default 100.
    • lastTime - The latest timestamp you want messages for, as a Date object or Unix timestamp.
    • lastOrdinal - The last ordinal you want messages for.
    • startTime - The earliest timestamp you want messages for, as a Date object or Unix timestamp.
    • startOrdinal - The first ordinal you want messages for.
  • callback - Called when the request completes
    • err - An Error object on failure, or null on success
    • response - The response object
      • messages - An array of objects with these properties
        • sender - A SteamID object
        • server_timestamp - A Date object for the message's timestamp
        • ordinal - The message's ordinal
        • message - The message text
        • server_message - An optional Server Message object
        • deleted - Boolean indicating whether the message is deleted
      • more_available - Boolean

Retrieves chat message history from a chat room group.

ackFriendMessage(friendSteamId, timestamp)

  • friendSteamId - A SteamID object or a string which can parse into one
  • timestamp - Either a Date object or a Unix timestamp for the newest message you want to mark as read

v4.5.0 or later is required to use this method

Acknowledges (marks as read) a message sent by a Steam friend. The timestamp you provide should be the timestamp of the newest chat message you have received, and it will mark all older chat messages as read. You must call this every time you receive a friend message or else your unread messages will pile up in offlineMessages.

ackChatMessage(chatGroupId, chatId, timestamp)

  • chatGroupId - The ID of the chat group in question
  • chatId - The ID of the chat room (channel) in question
  • timestamp - Either a Date object or a Unix timestamp for the newest message you want to mark as read

v4.5.0 or later is required to use this method

Acknowledges (marks as read) a message sent to a chat room. The timestamp you provide should be the timestamp of the newest chat message you have received, and it will mark all older chat messages as read. If the timestamp you provide is the timestamp of the latest message in the channel, the channel unread indicator will disappear in the Steam client.

Events ^

friendMessage

Emitted when a friend sends you a direct message.

friendMessageEcho

Emitted when you send a direct message to a friend on another client instance.

friendTyping

Emitted when a friend is typing you a direct message.

friendTypingEcho

Emitted when you are typing a friend a direct message on another client instance.

This has not been tested and may not be emitted.

friendLeftConversation

Emitted when a friend has closed their direct chat window with you.

This has not been tested and may not be emitted.

friendLeftConversationEcho

Emitted when you close your direct chat window with a friend on another instance.

This has not been tested and may not be emitted.

chatMessage

Emitted when a message is sent to a chat room you're in.

chatMessagesModified

  • details - An object containing these properties
    • chat_group_id - The ID of the chat room group containing the modified messages
    • chat_id - The ID of the chat room (channel) containing the modified messages
    • messages - An array of objects containing these properties
      • server_timestamp - A Date object for the timestamp of the message in question
      • ordinal - The ordinal of the message in question
      • deleted - Boolean determining if the message was deleted

Emitted when chat messages are modified (deleted) in a chat room you're in.

chatRoomGroupSelfStateChange

v4.21.0 or later is required to use this event

Emitted when we are invited to a chat room group and when we join, leave, or are kicked or banned from a chat room group. All other self-state change notifications in EChatRoomMemberStateChange are delivered via chatRoomGroupMemberStateChange.

If you have just joined a group and you want to receive chatRoomGroupMemberStateChange events, make sure you call setSessionActiveGroups.

chatRoomGroupMemberStateChange

  • details - An object containing these properties

v4.21.0 or later is required to use this event

Emitted when the state of a chat room group member changes, for example when a member leaves or is invited.

This event is only sent for chat room groups that you have set as active.

chatRoomGroupHeaderStateChange

  • details - An object containing these properties

v4.21.0 or later is required to use this event

Emitted when a chat room group's header (metadata) changes, including group chat name, tagline, avatar, or roles.

chatRoomGroupRoomsChange

  • details - An object containing these properties
    • chat_group_id - The ID of the chat room group whose rooms changed
    • default_chat_id - The ID of the default room ("home channel") for this group
    • chat_rooms - An array of Chat Room State objects

v4.12.0 or later is required to use this event

Emitted when the chat rooms change for a chat room group that you're a member of. For example, a room may have been added, renamed, or deleted. The details object contains the new metadata and chat room list for this group.

Clone this wiki locally