ChatEndpoint
ChatEndpoint
contains methods that facilitate communication with a channel's chatroom.
Methods
Authentication Required async sendMessage(chatroomId, message)
Sends a message into the specified chatroom.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
chatroomId | string | number | true | The chatroom where you want to send your message | |
message | string | true | The message to be sent | |
replyTo | ChatMessageReference | false | Information about the original message to reply to |
Returns
Promise<SendMessageResponse>
Authentication Required async deleteMessage(chatroomId, messageId)
Deletes a message in the specified chatroom by ID.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
chatroomId | string | number | true | The chatroom where you want to delete the message | |
messageId | string | true | The ID of the message you want to delete |
Returns
Promise<GenericApiResponse<null>>
Authentication Required async pinMessage(channel, messageId)
Pins a message in the specified channel by ID.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
chatroom | string | true | The channel where you want to pin the message | |
messageId | string | true | The ID of the message you want to pin |
Returns
Promise<GenericApiResponse<null>>
Authentication Required async banUser(channel, target, duration)
Ban a user from the specified channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
channel | string | true | The channel where you want to ban the user | |
target | string | true | The username of the user you want to ban | |
duration | number | false | Duration in minutes for how long the ban should last. If not provided, the ban is considered permanent |
Returns
Promise<GenericApiResponse<null>>
Authentication Required async unbanUser(channel, target)
Unban a user from the specified channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
channel | string | true | The channel from which you want to unban the user | |
target | string | true | The username of the user you want to unban |
Returns
Promise<GenericApiResponse<null>>