Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Chatroom

Implements

Index

Constructors

Methods

  • audioToMp3(_options: { url: string }): string
  • audioToText(_options: { url: string; done: any }): void
  • Audio to text Note that this feature is only available in NIM. Chat room has not yet implemented this feature.

    • Only supports the audio URL obtained by previewFile or sendFile, or the URL of the received audio message.

    Parameters

    Returns void

  • blurImage(_options: { radius: number; sigma: number; url: string; done?: any }): void
  • apply Gaussian blurring

    • Only support image URLs obtained by previewing files or sending file messages, or image URLs obtained after other image operations.

    Parameters

    • _options: { radius: number; sigma: number; url: string; done?: any }
      • radius: number

        Gaussian Blur Radius

      • sigma: number

        Gaussian fuzzy standard deviation, cannot be less than 0

      • url: string

        original URL to the image stored on NOS

      • done?:function

    Returns void

  • closeChatroom(_options: { custom?: string; done?: any }): void
  • connect(): void
  • After logging out of IM using the disconnect method, you can call connect to log in again. After calling getInstance, a persistent connection will be established automatically without calling connect.

    Associated function

    Example

    chatroom.disconnect({
    done: function() {
    chatroom.connect()
    }
    })

    Returns void

  • cropImage(_options: { height: number; url: string; width: number; x: number; y: number; done?: any }): void
  • Crop an image

    • Only support image URLs obtained by previewing files or sending file messages, or image URLs obtained after other image operations.
    • Capture an image with size (width*height) from coordinates (x, y). The value of (0, 0) represents the upper left corner
    • The value of width/height cannot be less than 0. If width/height is greater than the original width/height of the image, it will be replaced by the original width/height of the image.

    Parameters

    • _options: { height: number; url: string; width: number; x: number; y: number; done?: any }
      • height: number

        Height

      • url: string

        original URL to the image stored on NOS

      • width: number

        Width

      • x: number

        X coordinate, must be an integer

      • y: number

        Y coordinate, must be an integer

      • done?:function

    Returns void

  • deleteNosAccessToken(_options: { ext?: string; url: string; userAgent?: string; done: any }): void
  • Get the authentication token of the shortened URL.

    Parameters

    • _options: { ext?: string; url: string; userAgent?: string; done: any }
      • Optional ext?: string
      • url: string

        URL to a file

      • Optional userAgent?: string
      • done:function
        • Parameters

          • err: null | NIMCommonError | Error | NIMStrAnyObj
          • data: { resUrl: string; token: string }
            • resUrl: string

              full accessible URL

            • token: string

          Returns void

    Returns void

  • destroy(__options: { done: any }): void
  • disconnect(__options: { done: any }): void
  • getChatroom(_options: { done?: any }): void
  • getChatroomMemberCountByTag(_options: { tag: string; done: any }): void
  • getChatroomMembers(_options: { guest: boolean; limit?: number; onlyOnline?: boolean; time?: number; done: any }): void
  • getChatroomMembersByTag(_options: { limit?: number; tag: string; time?: number; done: any }): void
  • getChatroomMembersInfo(_options: { accounts: string[]; done: any }): void
  • getHistoryMsgs(_options: { limit?: number; msgTypes?: string[]; reverse?: boolean; timetag?: number; done: any }): void
  • Retrieve the message history of a chat room..

    • The number of returned messages is less than or equal to `limit`. To facilitate the generation of timestamps in the conversation, several timestamp data are inserted in the returned result. Therefore, the total number of the returned message may be greater than limit
    • If reverse is set to false, return the time < timetag
    • If reverse is set to true, return the time > timetag
    • If reverse is set to false, return the messages in descending order by time. Messages received earlier are displayed at the end.
    • If reverse is set to true, return the messages in ascending order by time. Messages received later are displayed at the end
    • When querying by page, the results may contain duplicated message. It is recommended that you remove duplicates using idClient

    Parameters

    • _options: { limit?: number; msgTypes?: string[]; reverse?: boolean; timetag?: number; done: any }
      • Optional limit?: number

        Limit, default value: 100

      • Optional msgTypes?: string[]

        Message types. All types of messages by default

      • Optional reverse?: boolean
        • if false, the message time < timetag, return queues sorted in descending order by time
        • if true, the message time > timetag。return queues sorted in ascending order by time
      • Optional timetag?: number

        timestamp in milliseconds. If unspecified or 0, the value will be affected by reverse

        • reverse = false, timetag takes the current server time by default
        • reverse = true, timetag takes the default value 0
      • done:function

    Returns void

  • getHistoryMsgsByTags(_options: { fromTime?: number; limit?: number; reverse?: 0 | 1; tags: string[]; toTime?: number; types: string[]; done: any }): void
  • Retrieve the message history of a chat room by tag.

    • The number of returned messages must be less than or equal to `limit`
    • If reverse is set to 0, query messages within time >= fromTime && time <= toTime
    • If reverse is set to 1, query messages within time >= fromTime && time <= toTime
    • If reverse is set to 0, return the messages in ascending order by time. Messages received later are displayed at the end
    • If reverse is set to 1, return the messages in descending order by time. Messages received earlier are displayed at the end.
    • When querying by page, the results may contain duplicated message. It is recommended that you remove duplicates using idClient

    Notes

    • If fromTime is specified, you must set toTime greater than fromTime, otherwise a parameter error will be reported
    • fromTime is set to 0 by default. The value of toTime is the current server time by default

    Parameters

    • _options: { fromTime?: number; limit?: number; reverse?: 0 | 1; tags: string[]; toTime?: number; types: string[]; done: any }
      • Optional fromTime?: number

        start time

      • Optional limit?: number

        Limit on quantity. Default value: 100

      • Optional reverse?: 0 | 1

        The default value is 0.

        • 0: indicates search from the fromTime backward and return the result sorted in ascending order by time.
        • 1: indicates search from the toTime forward, and return the result sorted in descending order by time.
      • tags: string[]

        Tags ['tag1', 'tag2', 'tag3']

      • Optional toTime?: number

        End time

      • types: string[]

        Message types

      • done:function

    Returns void

  • getNosAccessToken(_options: { ext?: string; url: string; userAgent?: string; done: any }): void
  • Get the authentication token of the shortened URL to get the file.

    • If the parameter nosScenes is set to a string starting with nim_security_ when uploading a file, you must obtain a token before downloading the file. The parameter nosScenes can be configured during initialization, or when sending and previewing a file
    • Delete CloudStorageInterface.deleteNosAccessToken the token in time after downloading the file to avoid token leakage

    Parameters

    • _options: { ext?: string; url: string; userAgent?: string; done: any }
      • Optional ext?: string
      • url: string

        URL to a file

      • Optional userAgent?: string
      • done:function
        • Parameters

          • err: null | NIMCommonError | Error | NIMStrAnyObj
          • data: { resUrl: string; token: string }
            • resUrl: string

              full accessible URL

            • token: string

          Returns void

    Returns void

  • getNosOriginUrl(_options: { safeShortUrl: string; done: any }): void
  • interlaceImage(_options: { url: string; done?: any }): void
  • interlace image

    • Only support image URLs obtained by previewing files or sending file messages, or image URLs obtained after other image operations.
    • When the network condition is poor, interlaced images appears blurry or with lower resolution and then gradually becomes clearer.

    Parameters

    • _options: { url: string; done?: any }

    Returns void

  • kickChatroomMember(_options: { account: string; custom: string; done?: any }): void
  • logout(): void
  • Log out

    Note: For SDK earlier than v9.6.0, it is recommended to logout first and disconnect/destroy to fully exit the chat room.. SDK v9.6.0 and later do not need to call this API, it will be called automatically before disconnect/destroy.

    Returns void

  • markChatroomBlacklist(_options: { account: string; custom?: string; isAdd: boolean; done: any }): void
  • Add a member to the blocklist

    • If a member is added to the blocklist, other members in the chat room receive a notification of type attach.type === 'blackMember'.
    • If a member is removed from the blocklist, other members in the chat room receive a notification of type attach.type === 'unblackMember' .
    • Members in the blocklist get notified by the ondisconnect callback, callback code = 'kicked', reason = 'blacked'
    • Members in the blocklist cannot join the chat room

    Parameters

    • _options: { account: string; custom?: string; isAdd: boolean; done: any }

    Returns void

  • markChatroomCommonMember(_options: { account: string; custom?: string; isAdd: boolean; level?: number; done: any }): void
  • markChatroomGaglist(_options: { account: string; custom?: string; isAdd: boolean; done: any }): void
  • Add a member to the list of muted members

    • If a member is added to the list of muted members, other members receive a notification of type attach.type === 'gagMember'.
    • If a member is removed from the list of muted members, other members in the chat room receive a notification of type attach.type === 'ungagMember'.
    • Members in the list cannot send messages

    Associated function

    Parameters

    • _options: { account: string; custom?: string; isAdd: boolean; done: any }

    Returns void

  • markChatroomIdentity(_options: { account: string; custom?: string; identity: string; isAdd: boolean; done: any }): void
  • markChatroomManager(_options: { account: string; custom?: string; isAdd: boolean; done: any }): void
  • packFileDownloadName(_options: { name: string; url: string }): string
  • peak(_options: { done: any }): void
  • Get the first element of the queue. The return data is the third parameter of the callback

    Parameters

    • _options: { done: any }
      • done:function
        • done(err: null | Error, data: object, Obj: { elementKey: string; elementValue: string }): void
        • Parameters

          • err: null | Error
          • data: object
          • Obj: { elementKey: string; elementValue: string }
            • elementKey: string

              UniqKey of the element, up to 128 bytes

            • elementValue: string

              content in the element, up to 4096 bytes

          Returns void

    Returns void

  • Upload and preview files. Send a file message by calling the method.

    Notes

    • Select one of the four parameters fileInput, file, blob, and filePath
    • fileInput: The id of the input element of type='file'. Do not operate the file on this node until the upload is complete
    • file: Parameters of the previewFile callback
    • blob: JavaScript object of blob type
    • filePath: React Native, Mini Program and other special JS runtime environments (the temporary path obtained by chooseImage)

    Notes

    • type: image, audio, video or file. The default value is file. The information contained in the file object in the message body is different
    • image: url, name, size, ext, w, h, type
    • audio: url, name, size, ext, container, dur
    • video: url, name, size, ext, container, dur, w, h
    • file: url, name, size, ext

    Notes

    • A maximum of 100MB for the file size is allowed
    • Advanced browsers will detect the file size before uploading
    • IE8/IE9 will detect the file size after uploading

    Parameters

    Returns void

  • processImage(_options: { ops: NIMStrAnyObj; url: string; done?: any }): void
  • Process an image

    This method receives a set of image operations, and processes the images in order of operations. The optional operations include:

    • Modify the image quality
    • interlace image
    • Rotate an image
    • apply Gaussian blurring
    • crop the image
    • generate a thumbnail
    • preview the file
    • send a file message

    For the parameters required for each operation, see the above methods. In addition to the parameters listed in the above methods, each operation needs to provide the operation types:

    • 'quality'
    • 'interlace'
    • 'rotate'
    • 'blur'
    • 'crop'
    • 'thumbnail'

    Code sample

    // Rotate after cropping
    var url = 'http://nim.nos.netease.com/MTAxMTAwMg==/bmltYV8xNDc5OTNfMTQ0MzE0NTgyNDI0M184YjFkYTMwMS02NjcxLTRiYjktYTUwZC04ZTVlZjZlNzZjMzA=';
    nim.processImage({
    url: url,
    ops: [
    {
    type: 'crop',
    x: 100,
    y: 0,
    width: 250,
    height: 250,
    },
    {
    type: 'thumbnail',
    mode: 'cover',
    width: 80,
    height: 80
    }
    ],
    done: processImageDone
    });
    function processImageDone(error, obj) {
    console.log('Processing the image' + (!error?'success':'failure'), error, obj);
    }

    Parameters

    • _options: { ops: NIMStrAnyObj; url: string; done?: any }
      • ops: NIMStrAnyObj

        Operation sequence for image processing. For specific format, see the previous interfaces for images

        similar effect

        [ { type: 'crop', x: 100, y: 0, width: 250, height: 250, }, { type: 'thumbnail', mode: 'cover', width: 80, height: 80 } ]

      • url: string
      • done?:function

    Returns void

  • qualityImage(_options: { quality: number; url: string; done?: any }): void
  • Modify the image quality

    • Only support image URLs obtained by previewing files or sending file messages, or image URLs obtained after other image operations.
    • The default image quality is 100. You can reduce the picture quality to save data usage for apps.

    Parameters

    • _options: { quality: number; url: string; done?: any }
      • quality: number

        Image quality, must be an integer, value range: 0-100

      • url: string

        original URL to the image stored on NOS

      • done?:function

    Returns void

  • queueChange(_options: { elementMap: {}; needNotify?: boolean; notifyExt?: string; done?: any }): void
  • Update multiple elements in a queue. If needNotify is set to true, all online users will receive the following notification. If needNotify is set to false, no users receive updates

    • attach.type === 'updateQueue'
    • attach.queueChange.type === 'BATCH_UPDATE'
    • attach.custom is notifyExt

    Parameters

    • _options: { elementMap: {}; needNotify?: boolean; notifyExt?: string; done?: any }
      • elementMap: {}

        update multiple key-value pairs of elements at a time, key and value points to elementKey and elementValue. elementKey can have 128 bytes and elementValue can have 4096 bytes. Up to 100 pairs can be updated at a time.

        • [key: string]: string
      • Optional needNotify?: boolean
      • Optional notifyExt?: string

        custom field in the notification object, up to 2048

      • done?:function
        • done(err: null | Error, data: NIMStrAnyObj, Obj: { elementKeyArray: string[] }): void
        • Callback for the result

          Parameters

          • err: null | Error
          • data: NIMStrAnyObj
          • Obj: { elementKeyArray: string[] }
            • elementKeyArray: string[]

          Returns void

    Returns void

  • queueDrop(_options: { done: any }): void
  • queueList(_options: { done: any }): void
  • Get the queue of a chat room queue

    Parameters

    • _options: { done: any }
      • done:function
        • done(err: null | NIMCommonError | Error | NIMStrAnyObj, data: { queueList: { elementKey: string; elementValue: string }[] }): void
        • Parameters

          • err: null | NIMCommonError | Error | NIMStrAnyObj
          • data: { queueList: { elementKey: string; elementValue: string }[] }
            • queueList: { elementKey: string; elementValue: string }[]

          Returns void

    Returns void

  • queueOffer(_options: { elementAccount?: string; elementKey: string; elementValue: string; transient?: boolean; done?: any }): void
  • Add or update new elements in the queue. If elementKey already exists, update the element, otherwise insert a new element at the end of the queue. After the operation, all online users will receive the following notification message:

    • attach.type === 'updateQueue'
    • attach.queueChange.type === 'OFFER'

    Parameters

    • _options: { elementAccount?: string; elementKey: string; elementValue: string; transient?: boolean; done?: any }
      • Optional elementAccount?: string

        Optional parameter, the account to which elements belong. By default, the parameter is unspecified, the elements belongs to the current user. Administrators can specify the account to which the elements belong.

      • elementKey: string

        UniqKey of the new element, up to 128 bytes

      • elementValue: string

        Content in the new element, up to 4096 bytes

      • Optional transient?: boolean

        Optional, the default value false is used if unspecified. Whether the element is deleted when the account who submits the element gets disconnected or leaves the chat room.

      • done?:function

    Returns void

  • queuePoll(_options: { elementKey?: string; done: any }): void
  • Delete an element in the queue. After the operation, all online users will receive the following notification message:

    • attach.type === 'updateQueue'
    • attach.queueChange.type === 'POLL'

    Parameters

    • _options: { elementKey?: string; done: any }
      • Optional elementKey?: string

        The UniqKey of the element to be taken, An empty value indicates the first element will be taken.

      • done:function
        • done(err: null | Error, data: { elementKey?: string }, Obj: { elementKey: string; elementValue: string }): void
        • callback for the result

          Parameters

          • err: null | Error
          • data: { elementKey?: string }
            • Optional elementKey?: string
          • Obj: { elementKey: string; elementValue: string }
            • elementKey: string

              UniqKey of the element, up to 128 bytes

            • elementValue: string

              content in the element, up to 4096 bytes

          Returns void

    Returns void

  • rotateImage(_options: { angle: number; url: string; done?: any }): void
  • Rotate an image

    • Only support image URLs obtained by previewing files or sending file messages, or image URLs obtained after other image operations.

    Parameters

    • _options: { angle: number; url: string; done?: any }
      • angle: number

        Rotation angle

      • url: string

        original URL to the image stored on NOS

      • done?:function

    Returns void

  • Description

    You can call this API for custom messages, such as rock-paper-scissors and dice rolling.

    Notes

    This interface returns the message body in the sending state, and the sent message body needs to be obtained by passing options.done.

    Scope

    Calling this API can trigger:

    1. callback NIMChatroomGetInstanceOptions.onmsgs for recipients
    2. Callback NIMChatroomGetInstanceOptions.onmsgs triggered on other logged-in devices.

    Example

    chatroom.sendCustomMsg({
    //The recipient receives the message using onMsg
    //if msg.type === 'custom', the recipient reads msg.content and then calls the business code
    content: JSON.stringify({type: 1}),
    done: function(err, msg) {
    if (err) {
    console.log('Failed to send the message', err)
    } else {
    console.log('Message sent: ', msg)
    }
    }
    })

    Parameters

    Returns NIMChatroomMessage

  • Description

    Send pictures, videos, audio or other files. You can optionally call sendFile to upload and send a file. You can also call previewFile to upload the file first, and then call sendFile to send the file

    Notes

    • This interface returns the message body in the sending state, and the sent message body needs to be obtained by passing options.done.

    Notes

    • Select one of the four parameters fileInput, file, blob, and filePath
    • fileInput: The id of the input DOM element with type='file'. Do not operate the file on this node until the upload is complete
    • file: Parameters of the previewFile function
    • blob: JavaScript object of Blob type
    • filePath: React Native, Mini Program and other special JS runtime environments (the temporary path obtained by chooseImage)

    Notes

    • type: image, audio, video or file. The default value is file. The information contained in the file object in the message body is different
    • image: url, name, size, ext, w, h, type
    • audio: url, name, size, ext, container, dur
    • video: url, name, size, ext, container, dur, w, h
    • file: url, name, size, ext

    Scope

    Calling this API can trigger:

    1. callback NIMChatroomGetInstanceOptions.onmsgs for recipients
    2. Callback NIMChatroomGetInstanceOptions.onmsgs triggered on other logged-in devices.

    Send a file

    chatroom.sendFile({
    type: 'image',
    fileInput: 'domId',
    done: function(err, msg) {
    if (err) {
    console.log('Failed to send the message', err)
    } else {
    console.log('Message sent: ', msg)
    }
    }
    })

    Upload a file using previewFile and send the file

    chatroom.previewFile({
    type: 'image',
    fileInput: fileInput,
    uploadprogress: function(obj) {
    console.log('Total size of a file: ' + obj.total + 'bytes');
    console.log('Size of uploaded data: ' + obj.loaded + 'bytes');
    console.log('Upload progress: ' + obj.percentage);
    console.log('Upload progress in percentage: ' + obj.percentageText);
    },
    done: function(error, file) {
    console.log('Uploading the image' + (!error?'success':'failure'));
    // show file to the user
    if (!error) {
    var msg = chatroom.sendFile({
    file: file,
    done: sendMsgDone
    });
    console.log('Sending the image message, id=' + msg.idClient);
    pushMsg(msg);
    }
    }
    })

    Resend a message

      let message = chatroom.sendFile({
    type: 'image',
    fileInput: 'domId',
    done: function(err, obj) {
    if (err) {
    console.log('Failed to send the message', err)
    // Resend the message. When the file upload fails, the msg of the obj parameter contains the message body, and in other cases, the obj is the message body.
    setTimeout(function () {
    resendMessage(obj.msg ? obj.msg : obj)
    }, 3000)
    } else {
    console.log('Message sent: ', obj)
    }
    }
    })

    // Get the idClient for rendering before uploading
    console.log(message.idClient)

    // Resend the message
    function resendMessage(oldMessage) {
    nim.sendFile(Object.assign(oldMessage, {
    type: 'image',
    fileInput: 'domId',
    resend: true, // Note that the resend is marked as true, so that the idClient in oldMessage can be used.
    done: function(err, obj) {
    if (err) {
    console.log('Failed to send the message', err)
    } else {
    console.log('Message sent: ', obj)
    }
    }
    }))
    }

    Associated links

    Parameters

    Returns NIMChatroomMessage

  • Description

    Send a location message

    Notes

    This interface returns the message body in the sending state, and the sent message body needs to be obtained by passing options.done.

    Scope

    Calling this API can trigger:

    1. callback NIMChatroomGetInstanceOptions.onmsgs for recipients
    2. Callback NIMChatroomGetInstanceOptions.onmsgs triggered on other logged-in devices.

    Example

    chatroom.sendGeo({
    //The recipient receives the message using onMsg
    //if msg.type === 'geo', the recipient reads msg.geo, and then calls the business code
    geo: {
    lng: 116.3833,
    lat: 39.9167,
    title: 'Beijing'
    },
    done: function(err, msg) {
    if (err) {
    console.log('Failed to send the message', err)
    } else {
    console.log('Message sent: ', msg)
    }
    }
    })

    Parameters

    Returns NIMChatroomMessage

  • Description

    Sending an alert Alerts are sent for notifications in a conversation. Typical use cases include welcome messages when joining a group or tips when hitting keywords for moderation in chats.

    Notes

    This interface returns the message body in the sending state, and the sent message body needs to be obtained by passing options.done.

    Scope

    Calling this API can trigger:

    1. callback NIMChatroomGetInstanceOptions.onmsgs for recipients
    2. Callback NIMChatroomGetInstanceOptions.onmsgs triggered on other logged-in devices.

    Example

    chatroom.sendTipMsg({
    //The recipient receives the message using onMsg
    //if msg.type === 'tip', the recipient reads msg.tip, and then calls the business code
    tip: 'tip content',
    done: function(err, msg) {
    if (err) {
    console.log('Failed to send the message', err)
    } else {
    console.log('Message sent: ', msg)
    }
    }
    })

    Parameters

    Returns NIMChatroomMessage

  • stripImageMeta(_options: { url: string; done: any }): string
  • Remove the metadata of an image

    • Only support image URLs obtained by previewing files or sending file messages, or image URLs obtained after other image operations.
    • Image without meta information will not contain EXIF information

    Parameters

    Returns string

  • thumbnailImage(_options: { axis: { x: number; y: number }; height?: number; url: string; width?: number; done?: any }): void
  • Generate the thumbnails of an image

    • Only support image URLs obtained by previewing files or sending file messages, or image URLs obtained after other image operations.
    • The value of width/height limits the size of the thumbnail. - The value of width/height must be greater than or equal to 0, cannot be 0 at the same time, and must be less than 4096
    • The thumbnails generated in different modes are different, currently the following three modes are supported:
    • 'cover': The original image is scaled in proportion, one side of the thumbnail is equal to the requested size, and the other side is larger than the requested size, that is, the thumbnail can just cover the rectangle with the size of width*height
    • 'contain': The original image is proportional to the thumbnail, one side of the thumbnail is equal to the requested size, and the other side is larger than the requested size, that is, a rectangle with a size of width*height can just cover the thumbnail
    • 'crop': First get the thumbnail based on the original image proportionally so that one side is equal to the requested size and the other side is larger than the requested size, and then crop the side larger than the requested size so that the final image size is exactly equal to the requested size (Note: the crop mode does not support thumbnails to GIFs)
    • If the size of the thumbnail is larger than the size of the picture, the picture will not be enlarged by default, you can pass the parameter `enlarge= true to enlarge the picture.
    • In 'crop' mode, parameters axis.x or axis.y can be used to control the position of the last cropping step.
    • The value X and Y must be integers, the value range is 0-10. This method internally uses Math.round to format x/y.
    • If X is set to 0, the leftmost side is cropped and if X is set tos 10, the rightmost side is cropped
    • If Y is 0, it means to crop the top. If Y is 10, it means to crop the bottom.
    • The default value of x/y is 5, that is, cut the middle

    Parameters

    • _options: { axis: { x: number; y: number }; height?: number; url: string; width?: number; done?: any }
      • axis: { x: number; y: number }

        coordinates for cropping

        • x: number

          Y coordinate, must be an integer

        • y: number

          Y coordinate, must be an integer

      • Optional height?: number

        Height of a thumbnail

      • url: string

        original URL to the image stored on NOS

      • Optional width?: number

        Width of a thumbnail

      • done?:function

    Returns void

  • updateChatroom(_options: { antiSpamBusinessId?: string; chatroom: { announcement?: string; broadcastUrl?: string; custom?: string; name?: string; queuelevel?: string }; custom?: string; needNotify: boolean; done?: any }): void
  • Update the chat room profile. The server API:

    Parameters

    • _options: { antiSpamBusinessId?: string; chatroom: { announcement?: string; broadcastUrl?: string; custom?: string; name?: string; queuelevel?: string }; custom?: string; needNotify: boolean; done?: any }
      • Optional antiSpamBusinessId?: string

        Business ID for moderation

      • chatroom: { announcement?: string; broadcastUrl?: string; custom?: string; name?: string; queuelevel?: string }

        Chat room profile to be updated

        • Optional announcement?: string

          Announcement in a chat room

        • Optional broadcastUrl?: string

          URL of a live streaming

        • Optional custom?: string

          Extension field

        • Optional name?: string

          The name of a chat room

        • Optional queuelevel?: string

          Permission for queue management: 0: all members have the permission to change the queue. 1: Only the owner and administrators can change the queue.

      • Optional custom?: string

        extension field for notifications

      • needNotify: boolean

        Whether the notification is required

      • done?:function

    Returns void

  • updateChatroomMemberTempMute(_options: { account: string; custom?: string; duration: number; needNotify: boolean; done?: any }): void
  • updateTagMembersTempMute(_options: { custom?: string; duration: number; needNotify: boolean; notifyTargetTags?: string; tag: string; done?: any }): void
  • updateTags(_options: { ext?: string; needNotify?: true; notifyTargetTags?: string; tags?: string[]; done?: any }): void
  • Update the tag for the current persistent connection. If you update the tags by calling Server API, tags associated with the current persistent connection.

    Associated function

    Parameters

    • _options: { ext?: string; needNotify?: true; notifyTargetTags?: string; tags?: string[]; done?: any }
      • Optional ext?: string

        extension field of notifications, JSON string is recommended.

      • Optional needNotify?: true

        Whether a notification is required the update, default value: false, The scope of target members is defined by notifyTargetTags (note that notifyTargetTags can be configured during the initialization of a chat room)

      • Optional notifyTargetTags?: string

        Tags for notifications, a tag expression used to send notifications for members with specific tags. For example, a member gets online or offline. If unspecified, all members will receive the notification.

      • Optional tags?: string[]

        Tags. Multiple tags are allowed. You can override the value by updates. Example, ["tag1", "tag2"];To delete the tags, leave the value empty. If an empty array is specified, the tags are used but belong to no categories.

      • done?:function

    Returns void