Skip to content

Commit

Permalink
Throwing 'Message not found' error when fetching from empty channel o…
Browse files Browse the repository at this point in the history
…r without read history permission. (#1394)
  • Loading branch information
SpaceEEC authored and iCrawl committed Apr 28, 2017
1 parent 1601ad1 commit 95bcac9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/structures/interfaces/TextBasedChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ class TextBasedChannel {
fetchMessage(messageID) {
if (!this.client.user.bot) {
return this.fetchMessages({ limit: 1, around: messageID }).then(messages => {
const msg = messages.first();
if (msg.id !== messageID) throw new Error('Message not found.');
const msg = messages.get(messageID);
if (!msg) throw new Error('Message not found.');
return msg;
});
}
Expand Down

0 comments on commit 95bcac9

Please sign in to comment.