Skip to content

User

Definitions

User

FIELDTYPEDESCRIPTION
idstringuser id
namestring?user name[1]
nickstring?user nickname[1]
avatarstring?user avatar
is_botboolean?whether the user is a bot

TIP

[1] Difference between name and nick

Both fields can be used to identify a user. On some platforms (e.g., Telegram), a user may have multiple types of names, so the SDK can set both fields. On other platforms, these concepts may not be distinct, in which case the SDK only needs to set either name or nick based on semantics.

In application-level implementations, nick takes precedence over name because nicknames are easier for users to recognize and understand. If you are developing a client based on the Satori protocol, you should prioritize displaying the nick field for usernames and only use the name field when nick is absent.

API

Get User Information

POST /user.get
FIELDTYPEDESCRIPTION
user_idstringuser id

Get a user by id. Returns a User object.

Get Friend List

POST /friend.list
FIELDTYPEDESCRIPTION
nextstring?pagination token

Get the friend list. Returns a paginated list of User objects.

Handle Friend Request

POST /friend.approve
FIELDTYPEDESCRIPTION
message_idstringrequest id
approvebooleanwhether to approve the request
commentstring?comment

Handle a friend request.

Events

friend-request

Triggered when a new friend request is received. Required resource: user.