mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
removed ES6 function calls
This commit is contained in:
@@ -159,9 +159,14 @@ export default class Resolver {
|
|||||||
}
|
}
|
||||||
if (resource instanceof User) {
|
if (resource instanceof User) {
|
||||||
// see if a PM exists
|
// see if a PM exists
|
||||||
var chatFound = this.internal.private_channels.find(
|
var chatFound = false;
|
||||||
pmchat => pmchat.recipient.equals(resource)
|
for (var pmchat of this.internal.private_channels) {
|
||||||
);
|
if (pmchat.recipient.equals(resource)) {
|
||||||
|
chatFound = pmchat;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chatFound) {
|
if (chatFound) {
|
||||||
// a PM already exists!
|
// a PM already exists!
|
||||||
return Promise.resolve(chatFound);
|
return Promise.resolve(chatFound);
|
||||||
|
|||||||
@@ -55,7 +55,11 @@ export default class Cache extends Array {
|
|||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
var index = this.indexOf(item);
|
var index = this.indexOf(item);
|
||||||
Object.assign(this[index], data);
|
for (var dataIndex in data) {
|
||||||
|
if (data.hasOwnProperty(dataIndex)) {
|
||||||
|
this[index][dataIndex] = data[dataIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
this[discrimCacheS][data[this[discrimS]]] = this[index];
|
this[discrimCacheS][data[this[discrimS]]] = this[index];
|
||||||
return this[index];
|
return this[index];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user