Accept user IDs as channels

This commit is contained in:
abalabahaha
2016-03-12 21:11:21 -08:00
parent ea80677a79
commit 14fffb12af
2 changed files with 12 additions and 2 deletions

View File

@@ -286,7 +286,12 @@ var Resolver = (function () {
return Promise.resolve(resource.defaultChannel);
}
if (resource instanceof String || typeof resource === "string") {
return Promise.resolve(this.internal.channels.get("id", resource) || this.internal.private_channels.get("id", resource));
var user = this.internal.users.get("id", resource);
if (user) {
resource = user;
} else {
return Promise.resolve(this.internal.channels.get("id", resource) || this.internal.private_channels.get("id", resource));
}
}
if (resource instanceof _StructuresUser2["default"]) {
// see if a PM exists