LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

sysManage#

sysManage#

sysManage.sendRosterMessage(msg) ⇒ number#

SendSingle chat message

Kind: static method of sysManage
Returns: number - Message ID generated by client

ParamTypeDescription
msgobjectMessage body
msg.uidstringReceiver ID
msg.contentstringMessage content
msg.typestringMessage types: text, image, audio, video, file, location, command, forward
msg.extstring | objectExtension data
msg.attachmentstring | objectAttachment info

Example

{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="sendRosterMessage" %}{% endlanying_code_snippet %}

sysManage.sendGroupMessage(msg) ⇒ number#

SendGroup chat message

Kind: static method of sysManage
Returns: number - Message ID generated by client

ParamTypeDescription
msgobjectSend message body
msg.gidstringGroupID
msg.contentstringMessage content
msg.typestringMessage types: text, image, audio, video, file, location, command, forward
msg.extstring | objectExtension data
msg.attachmentstring | objectAttachment info
msg.prioritynumberSet message diffusion priority, default 0. 0 means diffusion, and the smaller the number, the more diffused.

Example

{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="sendGroupMessage" %}{% endlanying_code_snippet %}

sysManage.requireHistoryMessage(uid, sid, amount)#

Request history

Kind: static method of sysManage

ParamTypeDescription
uidnumberSessionID
sidnumberMessage ID: the message to pull forward from, 0 means pulling from the latest message.
amountnumberNumber of messages to pull

Example

{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="requireHistoryMessage" %}{% endlanying_code_snippet %}

sysManage.sendMentionMessage(params) ⇒ number#

Group-sent @message

Kind: static method of sysManage
Returns: number - Message ID generated by client

ParamTypeDescription
paramsobject
params.gidnumberGroupID
params.txtstringMessage text content
params.mentionAllbooleanWhether to @ everyone
params.mentionListArray.<number>List of @member IDs
params.mentionedMessagestringDisplay content of @messages
params.mentionedMessagestringPush content of @messages
params.senderNicknamestringSender's nickname

Example

{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="sendMentionMessage" %}{% endlanying_code_snippet %}

sysManage.sendInputStatusMessage(uid, status) ⇒ number#

Send type status

Kind: static method of sysManage
Returns: number - Message ID generated by client

ParamTypeDescription
uidnumberSessionID
statusstringStatus: nothing - no typing, typing - typing

Example

{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="sendInputStatusMessage" %}{% endlanying_code_snippet %}

sysManage.forwardMessage(param) ⇒ number#

Forward message

Kind: static method of sysManage
Returns: number - Message ID generated by client

ParamTypeDescription
paramobjectParameter
param.uidnumberReceiver's user ID (set only when forwarding a shingle chat)
param.gidnumberReceiver's group ID (set only when forwarding a group chat)
param.midnumberMessage to forwardID

Example

{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="forwardMessage" %}{% endlanying_code_snippet %}

sysManage.getMessageStatus(cid, mid, isGroup) ⇒ string#

Get message status

Kind: static method of sysManage
Returns: string - Message status: unread, delivered, read

ParamTypeDefaultDescription
cidnumberSessionID
midnumberMessageID
isGroupbooleanfalseWhether it is a group chat

Example

{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="getMessageStatus" %}{% endlanying_code_snippet %}

sysManage.asyncFileUpload(param) ⇒ Promise.<FileUploadResult>#

Upload file

Kind: static method of sysManage
Returns: Promise.<FileUploadResult> - File uploading result

ParamTypeDescription
paramobjectParameter
param.group_dnumberGroupID
param.toTypenumberReceiver types: rosterAvatar - user avatar, chat - chat file, groupAvatar - group avatar
param.to_idnumberReceiver ID
param.fileFileFile
param.fileTypestringFile types: file - general chat file, audio - voice chat file (amr format), image - image chat file, video - video chat file, audio-mp3 - voice chat file (mp3 format), shareFile - general shared file, shareAudio - voice shared file, shareImage - image shared files, shareVideo - video shared files
param.chatTypenumberChat types: roster - single chat, group - group chat
param.processCallbackfileUploadProgressUpload progressCallback

Example

{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="asyncFileUpload" %}{% endlanying_code_snippet %}

sysManage.getImage(param) ⇒ string#

Assemble image path

Kind: static method of sysManage
Returns: string - ImageAddress

ParamTypeDescription
paramobject
param.avatarstringFileAddress
param.typestringTypes: roster - user, group - group
param.thumbnailbooleanThumbnail or not: true by default
param.sdefaultstringDefault image address

Example

{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="getImage" %}{% endlanying_code_snippet %}

sysManage.deleteConversation(id, other_devices)#

Delete session

Kind: static method of sysManage

ParamTypeDefaultDescription
idnumberSessionID
other_devicesbooleantrueWhether to delete conversations on other devices at the same time

Example

{% lanying_code_snippet repo="lanying-im-web",class="sysManage",function="deleteConversation" %}{% endlanying_code_snippet %}

sysManage.asyncGetGroupAvatarUploadUrl(params) ⇒ Promise.<FileUpload>#

Get the URL of uploading group avatar

Kind: static method of sysManage
Returns: Promise.<FileUpload> - File uploading info

ParamTypeDescription
paramsobjectParameter
params.group_idnumberGroupID

sysManage.asyncGetFileUploadChatFileUrl(params) ⇒ Promise.<FileUpload>#

Get upload address of chat file

Kind: static method of sysManage
Returns: Promise.<FileUpload> - File uploading info

ParamTypeDescription
paramsobjectParameter
params.file_typenumberFile types: 100 - general chat file, 101 - voice chat file (amr format), 102 - image chat file, 103 - video chat file, 104 - voice chat file (mp3 format) 200 - general shared file, 201 - voice shared file, 202 - image shared file, 203 - video shared file
params.to_typenumberConversation types: 1 - user, 2 - group
params.to_idnumberSessionID
Generated API content with concise AI notes where context helps.