mirror of
https://github.com/danbulant/discord.js
synced 2026-07-06 11:40:41 +00:00
resolveChannel should take PM channel IDs
This commit is contained in:
parent
fd34c935a2
commit
e4641fe701
2 changed files with 4 additions and 4 deletions
|
|
@ -277,10 +277,10 @@ var Resolver = (function () {
|
||||||
return Promise.resolve(resource);
|
return Promise.resolve(resource);
|
||||||
}
|
}
|
||||||
if (resource instanceof _StructuresServer2["default"]) {
|
if (resource instanceof _StructuresServer2["default"]) {
|
||||||
return Promise.resolve(resource.channels.get("id", resource.id));
|
return Promise.resolve(resource.defaultChannel);
|
||||||
}
|
}
|
||||||
if (resource instanceof String || typeof resource === "string") {
|
if (resource instanceof String || typeof resource === "string") {
|
||||||
return Promise.resolve(this.internal.channels.get("id", resource));
|
return Promise.resolve(this.internal.channels.get("id", resource) || this.internal.private_channels.get("id", resource));
|
||||||
}
|
}
|
||||||
if (resource instanceof _StructuresUser2["default"]) {
|
if (resource instanceof _StructuresUser2["default"]) {
|
||||||
// see if a PM exists
|
// see if a PM exists
|
||||||
|
|
|
||||||
|
|
@ -207,10 +207,10 @@ export default class Resolver {
|
||||||
return Promise.resolve(resource);
|
return Promise.resolve(resource);
|
||||||
}
|
}
|
||||||
if (resource instanceof Server) {
|
if (resource instanceof Server) {
|
||||||
return Promise.resolve(resource.channels.get("id", resource.id));
|
return Promise.resolve(resource.defaultChannel);
|
||||||
}
|
}
|
||||||
if (resource instanceof String || typeof resource === "string") {
|
if (resource instanceof String || typeof resource === "string") {
|
||||||
return Promise.resolve(this.internal.channels.get("id", resource));
|
return Promise.resolve(this.internal.channels.get("id", resource) || this.internal.private_channels.get("id", resource));
|
||||||
}
|
}
|
||||||
if (resource instanceof User) {
|
if (resource instanceof User) {
|
||||||
// see if a PM exists
|
// see if a PM exists
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue