File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ export class MessageReactionNoticeEvent extends NoticeEvent{
500
500
this . guild_id = payload . guild_id
501
501
this . channel_id = payload . channel_id
502
502
this . user_id = payload . user_id
503
- if ( payload . target . type !== ReactionTargetType . Message ) throw new Error ( `unsupported reaction target type: ${ payload . target . type } ` )
503
+ if ( ! [ ReactionTargetType . Message , ReactionTargetType . ReactionTargetType_MSG ] . includes ( payload . target . type ) ) throw new Error ( `unsupported reaction target type: ${ payload . target . type } ` )
504
504
this . message_id = payload . target . id
505
505
this . emoji = payload . emoji
506
506
}
Original file line number Diff line number Diff line change @@ -87,9 +87,14 @@ export class QQBot extends EventEmitter {
87
87
const event_id = wsRes . id || '' ;
88
88
if ( ! payload || ! event ) return ;
89
89
const transformEvent = QQEvent [ event ] || 'system'
90
- const result = this . processPayload ( event_id , transformEvent , payload )
91
- if ( ! result ) return this . logger . debug ( '解析事件失败' , wsRes )
92
- this . em ( transformEvent , result ) ;
90
+
91
+ try {
92
+ const result = this . processPayload ( event_id , transformEvent , payload )
93
+ if ( ! result ) return this . logger . debug ( '解析事件失败' , wsRes )
94
+ this . em ( transformEvent , result ) ;
95
+ } catch ( error ) {
96
+ return this . logger . debug ( '解析事件失败' , wsRes )
97
+ }
93
98
}
94
99
/**
95
100
* 上传多媒体文件
Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ export enum ReactionTargetType{
166
166
Message ,
167
167
Thread ,
168
168
Comment ,
169
- Reply
169
+ Reply ,
170
+ ReactionTargetType_MSG = 'ReactionTargetType_MSG'
170
171
}
171
172
You can’t perform that action at this time.
0 commit comments