messages.forwardToGroup()
This method allows you to forward a message to a Group with or without priority.
Definition
client.messages.forwardToGroup(messageId: string|Object,groupId: string,options: ?Object)
Parameters
Parameter | Type | Description |
---|---|---|
messageId | string |Message | A message ID or message object that is to be forwarded |
groupId | string | Group ID where that message should be forwarded |
options | ?Object | Options (described below) |
Options
Parameter | Type | Description |
---|---|---|
priority | ?string | Indicates priority level of message. Values: NORMAL (default), or HIGH |
senderId | ?string | ID of the user who is forwarding the message, default is current user |
Returns
An error will be thrown if the messageId
or groupId
are invalid.
Otherwise, once the returned Promise
is resolved, you will have a newly forwarded Message.
Example
Forward to group with normal priority:
const forwardedMessage = await client.messages.forwardToGroup('some-message-id','some-group-id-to-forward-to',{priority: client.enums.MessagePriority.NORMAL});console.log('forwarded message to', forwardedMessage.counterParty.name,'with priority of', forwardedMessage.priority,'original message from', forwardedMessage.originalSender.name);