diff --git a/src/event-bus.js b/src/event-bus.js index 1140686..acfb47f 100644 --- a/src/event-bus.js +++ b/src/event-bus.js @@ -48,7 +48,12 @@ class CQEventBus { approve: [], invite: [] }, - friend_add: [] + friend_add: [], + group_ban: { + '': [], + ban: [], + lift_ban: [] + } }, request: { '': [], diff --git a/src/index.js b/src/index.js index a9646e7..04a4e0e 100644 --- a/src/index.js +++ b/src/index.js @@ -301,6 +301,21 @@ class CQWebSocket extends $Callable { case 'friend_add': this._eventBus.emit('notice.friend_add', msgObj) break + case 'group_ban': + switch (msgObj.sub_type) { + case 'ban': + this._eventBus.emit('notice.group_ban.ban', msgObj) + break + case 'lift_ban': + this._eventBus.emit('notice.group_ban.lift_ban', msgObj) + break + default: + this._eventBus.emit('error', new UnexpectedContextError( + msgObj, + 'unexpected "sub_type"' + )) + } + break default: this._eventBus.emit('error', new UnexpectedContextError( msgObj,