mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
Merge remote-tracking branch 'origin/indev-rewrite' into indev-rewrite-sharding
This commit is contained in:
@@ -84,7 +84,7 @@ class ClientDataManager {
|
||||
}
|
||||
|
||||
killUser(user) {
|
||||
this.users.delete(user.id);
|
||||
this.client.users.delete(user.id);
|
||||
}
|
||||
|
||||
killChannel(channel) {
|
||||
|
||||
@@ -137,7 +137,7 @@ class GuildChannel extends Channel {
|
||||
const roleOverwrites = [];
|
||||
const memberOverwrites = [];
|
||||
|
||||
for (const overwrite of this.permissionOverwrites) {
|
||||
for (const overwrite of this.permissionOverwrites.values()) {
|
||||
if (overwrite.id === member.id) {
|
||||
memberOverwrites.push(overwrite);
|
||||
} else if (memberRoles.indexOf(overwrite.id) > -1) {
|
||||
|
||||
@@ -166,7 +166,7 @@ class TextBasedChannel {
|
||||
}
|
||||
|
||||
if (this.messages.size >= maxSize) {
|
||||
this.messages.delete(Array.from(this.messages.keys())[0]);
|
||||
this.messages.delete(this.messages.keys().next().value);
|
||||
}
|
||||
|
||||
this.messages.set(message.id, message);
|
||||
|
||||
@@ -77,6 +77,8 @@ class Collection extends Map {
|
||||
* collection.getAll('username', 'Bob');
|
||||
*/
|
||||
findAll(key, value) {
|
||||
if (typeof key !== 'string') throw new TypeError('key must be a string');
|
||||
if (typeof value === 'undefined') throw new Error('value must be specified');
|
||||
const results = [];
|
||||
for (const item of this.values()) {
|
||||
if (item[key] === value) {
|
||||
@@ -95,6 +97,8 @@ class Collection extends Map {
|
||||
* collection.get('id', '123123...');
|
||||
*/
|
||||
find(key, value) {
|
||||
if (typeof key !== 'string') throw new TypeError('key must be a string');
|
||||
if (typeof value === 'undefined') throw new Error('value must be specified');
|
||||
for (const item of this.values()) {
|
||||
if (item[key] === value) {
|
||||
return item;
|
||||
|
||||
Reference in New Issue
Block a user