src/Core/Event/EventManager.js
/**
     * Unregister a listener.
     * Recreate the handler without the unregistered listener and listen to the updated handler
     *
     * @param {String} event - Name of the Discord event
     * @param {String} label - Label of the listener
     * @returns {Boolean} True if worked / False if label or event doesn't exist
     * @memberof EventManager
     */
Unregister a listener.
Recreate the handler without the unregistered listener and listen to the updated handler

@param {String} event - Name of the Discord event
@param {String} label - Label of the listener
@returns {Boolean} True if worked / False if label or event doesn't exist
@memberof EventManager
Unregister a listener . Recreate the handler without the unregistered listener and listen to the updated handler @param { String } event - Name of the Discord event @param { String } label - Label of the listener @returns { Boolean } True if worked / False if label or event doesn ' t exist @memberof EventManager
unregisterListener(event, label) {
        if (!this._events[event] ) {
            return false;
        }
        const index = this._events[event].findIndex(e => e.label === label);
        if (index > -1) {
            this._events[event].splice(index, 1);
        } else {
            return false;
        }
        const res = this.unregisterHandler(event);
        if (!res) {
            return false;
        }
        this.registerEvent(event);
        this.logger.info(`EventManager: Listener ${label} for ${event} unregistered!`);
        return true;
    }
unregisterListener ( event , label ) { if ( ! this . _events [ event ] ) { return false ; } const index = this . _events [ event ] . findIndex ( e => e . label === label ) ; if ( index > - 1 ) { this . _events [ event ] . splice ( index , 1 ) ; } else { return false ; } const res = this . unregisterHandler ( event ) ; if ( ! res ) { return false ; } this . registerEvent ( event ) ; this . logger . info ( ` ${ label } ${ event } ` ) ; return true ; }
Unregister a listener.
Unregister a listener .