mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user