dist/cache/RoleCache.js
/**
     * Update a role
     * @param id - id of the role
     * @param guildId - id of the guild belonging to the role
     * @param data - new role data
     * @returns returns a bound RoleCache once the data was updated.
     */
Update a role
@param id - id of the role
@param guildId - id of the guild belonging to the role
@param data - new role data
@returns returns a bound RoleCache once the data was updated.
Update a role @param id - id of the role @param guildId - id of the guild belonging to the role @param data - new role data @returns returns a bound RoleCache once the data was updated .
async update(id, guildId, data) {
        var _a;
        if (this.boundObject) {
            this.bindObject(data);
        }
        if (!guildId) {
            return Promise.reject("Missing guild id");
        }
        if (!data.guild_id) {
            data.guild_id = guildId;
        }
        if (!data.id) {
            data.id = id;
        }
        await this.addToIndex(id, guildId);
        await ((_a = this.storageEngine) === null || _a === void 0 ? void 0 : _a.upsert(this.buildId(id, guildId), this.structurize(data)));
        if (this.boundObject)
            return this;
        return new RoleCache(this.storageEngine, this.rain, data);
    }
async update ( id , guildId , data ) { var _a ; if ( this . boundObject ) { this . bindObject ( data ) ; } if ( ! guildId ) { return Promise . reject ( "Missing guild id" ) ; } if ( ! data . guild_id ) { data . guild_id = guildId ; } if ( ! data . id ) { data . id = id ; } await this . addToIndex ( id , guildId ) ; await ( ( _a = this . storageEngine ) === null || _a === void 0 ? void 0 : _a . upsert ( this . buildId ( id , guildId ) , this . structurize ( data ) ) ) ; if ( this . boundObject ) return this ; return new RoleCache ( this . storageEngine , this . rain , data ) ; }
Update a role
 @param id - id of the role
 @param guildId - id of the guild belonging to the role
 @param data - new role data
 @returns returns a bound RoleCache once the data was updated.
Update a role @param id - id of the role @param guildId - id of the guild belonging to the role @param data - new role data @returns returns a bound RoleCache once the data was updated .
// @ts-ignore // @ts-ignore