Skip to content

Commit 709ab33

Browse files
committed
fix event no msgid
1 parent ab737fd commit 709ab33

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/official-account/webhook.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import http from 'http'
22
import express from 'express'
33
import xmlParser from 'express-xml-bodyparser'
44
import localtunnel from 'localtunnel'
5-
5+
import * as UUID from 'uuid'
66
import { log } from 'wechaty-puppet'
77
import { EventEmitter } from 'events'
88
import type TypedEventEmitter from 'typed-emitter'
@@ -259,6 +259,9 @@ class Webhook extends WebhookEventEmitter {
259259
/**
260260
* TODO: support more MsgType
261261
*/
262+
if (payload.MsgType === 'event') {
263+
payload.MsgId = UUID.v4()
264+
}
262265
if (knownTypeList.includes(payload.MsgType)) {
263266
if (payload.MsgType === 'event' && payload.Event !== 'CLICK') return
264267
this.emit('message', payload)

0 commit comments

Comments
 (0)