Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Commit

Permalink
feat: add group_ban event
Browse files Browse the repository at this point in the history
fix #84
  • Loading branch information
MomoCow committed Jan 31, 2020
1 parent cd4a348 commit 928e257
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/event-bus.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ class CQEventBus {
approve: [],
invite: []
},
friend_add: []
friend_add: [],
group_ban: {
'': [],
ban: [],
lift_ban: []
}
},
request: {
'': [],
Expand Down
15 changes: 15 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 928e257

Please sign in to comment.