diff --git a/src/user-modules/message.ts b/src/user-modules/message.ts index b8b3f2210..3e1241e8b 100644 --- a/src/user-modules/message.ts +++ b/src/user-modules/message.ts @@ -370,6 +370,23 @@ class MessageMixin extends MixinBase implements SayableSayer { return broadcastStatus } + static async mergeForward (to: ContactInterface | RoomInterface, messageList: MessageInterface[]): Promise { + log.verbose('Message', `mergeForward(${messageList})`) + try { + const msgId = await this.wechaty.puppet.messageForward( + to.id, + messageList.map(msg => msg.id), + ) + if (msgId) { + const msg = await this.wechaty.Message.find({ id: msgId }) + return msg + } + } catch (e) { + log.error('Message', 'forward(%s) exception: %s', to, e) + throw e + } + } + /** * * Instance Properties