fix resolveServer undefined when TextChannel

So far it has been the case that resolveServer has been returning
undefined in the case that the resource was a Message from a TextChannel.
This was the case because the conditional returned the value of member
"server" in the Message object. The Message object doesn't have a server
member though. The fix is to use the "channel" member of the Message
object and return its "server" member which was likely the original
intention considering the if statement.
This commit is contained in:
SooYou
2016-02-06 18:14:24 +01:00
parent 4b8f85d44a
commit fd5c981d83
2 changed files with 2 additions and 2 deletions

View File

@@ -96,7 +96,7 @@ var Resolver = (function () {
}
if (resource instanceof _StructuresMessage2["default"]) {
if (resource.channel instanceof _StructuresTextChannel2["default"]) {
return resource.server;
return resource.channel.server;
}
}
return null;

View File

@@ -54,7 +54,7 @@ export default class Resolver {
}
if (resource instanceof Message) {
if (resource.channel instanceof TextChannel) {
return resource.server;
return resource.channel.server;
}
}
return null;