mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
refactor: change parameter names
This commit is contained in:
@@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user