refactor: change parameter names

This commit is contained in:
Danial Raza
2023-09-18 18:04:38 +00:00
parent 14a54f3396
commit c319c5456a
3 changed files with 4 additions and 8 deletions

View File

@@ -94,9 +94,9 @@ class ReactionCollector extends Collector {
this.users.set(user.id, user); this.users.set(user.id, user);
}); });
this.on('remove', (reaction, user) => { this.on('remove', (_reaction, user) => {
this.total--; this.total--;
if (!this.collected.some(users => users.cache.has(user.id))) this.users.delete(user.id); if (!this.collected.some(reaction => reaction.users.cache.has(user.id))) this.users.delete(user.id);
}); });
} }

View File

@@ -22,9 +22,7 @@ class StickerPack extends Base {
* The stickers in the pack * The stickers in the pack
* @type {Collection<Snowflake, Sticker>} * @type {Collection<Snowflake, Sticker>}
*/ */
this.stickers = new Collection( this.stickers = new Collection(pack.stickers.map(sticker => [sticker.id, new Sticker(client, sticker)]));
pack.stickers.map(stickerPack => [stickerPack.id, new Sticker(client, stickerPack)]),
);
/** /**
* The name of the sticker pack * The name of the sticker pack

View File

@@ -165,9 +165,7 @@ class BitField {
if (typeof DefaultBit === typeof bit && bit >= DefaultBit) return bit; if (typeof DefaultBit === typeof bit && bit >= DefaultBit) return bit;
if (bit instanceof BitField) return bit.bitfield; if (bit instanceof BitField) return bit.bitfield;
if (Array.isArray(bit)) { if (Array.isArray(bit)) {
return bit return bit.map(bit_ => this.resolve(bit_)).reduce((prev, bit_) => prev | bit_, DefaultBit);
.map(permission => this.resolve(permission))
.reduce((prev, permission) => prev | permission, DefaultBit);
} }
if (typeof bit === 'string') { if (typeof bit === 'string') {
if (!isNaN(bit)) return typeof DefaultBit === 'bigint' ? BigInt(bit) : Number(bit); if (!isNaN(bit)) return typeof DefaultBit === 'bigint' ? BigInt(bit) : Number(bit);