mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 04:52:22 +00:00
Merge remote-tracking branch 'origin/indev-rewrite' into indev-rewrite-sharding
This commit is contained in:
commit
631626a3f9
4 changed files with 7 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue