mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
Attempt to fix startPM
This commit is contained in:
@@ -220,18 +220,12 @@ export default class Resolver {
|
||||
}
|
||||
if (resource instanceof User) {
|
||||
// see if a PM exists
|
||||
var chatFound = false;
|
||||
for (var pmchat of this.internal.private_channels) {
|
||||
if (pmchat.recipient.equals(resource)) {
|
||||
chatFound = pmchat;
|
||||
break;
|
||||
return Promise.resolve(pmchat);
|
||||
}
|
||||
}
|
||||
|
||||
if (chatFound) {
|
||||
// a PM already exists!
|
||||
return Promise.resolve(chatFound);
|
||||
}
|
||||
// PM does not exist :\
|
||||
return this.internal.startPM(resource);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user