feat: added group_admin_changed event (#2018)
* docs: updated * added group-admin-change event * minor changes * added usage example * minor changes: code docs updated
This commit is contained in:
parent
ac7df25075
commit
9f15499592
4 changed files with 27 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ const NoAuth = require('./authStrategies/NoAuth');
|
|||
* @fires Client#group_update
|
||||
* @fires Client#disconnected
|
||||
* @fires Client#change_state
|
||||
* @fires Client#group_admin_changed
|
||||
*/
|
||||
class Client extends EventEmitter {
|
||||
constructor(options = {}) {
|
||||
|
|
@ -317,6 +318,13 @@ class Client extends EventEmitter {
|
|||
* @param {GroupNotification} notification GroupNotification with more information about the action
|
||||
*/
|
||||
this.emit(Events.GROUP_LEAVE, notification);
|
||||
} else if (msg.subtype === 'promote' || msg.subtype === 'demote') {
|
||||
/**
|
||||
* Emitted when a current user is promoted to an admin or demoted to a regular user.
|
||||
* @event Client#group_admin_changed
|
||||
* @param {GroupNotification} notification GroupNotification with more information about the action
|
||||
*/
|
||||
this.emit(Events.GROUP_ADMIN_CHANGED, notification);
|
||||
} else {
|
||||
/**
|
||||
* Emitted when group settings are updated, such as subject, description or picture.
|
||||
|
|
|
|||
Loading…
Reference in a new issue