diff --git a/src/structures/interface/TextBasedChannel.js b/src/structures/interface/TextBasedChannel.js index 2901835c3..0a0161c9b 100644 --- a/src/structures/interface/TextBasedChannel.js +++ b/src/structures/interface/TextBasedChannel.js @@ -181,7 +181,8 @@ class TextBasedChannel { /** * Gets a single message from this channel, regardless of it being cached or not. - * This is only available when using a bot account. + * Since the single message fetching endpoint is reserved for bot accounts, this abstracts + * {@link #fetchMessages} to obtain the single message when using a user account. * @param {Snowflake} messageID ID of the message to get * @returns {Promise} * @example @@ -191,6 +192,13 @@ class TextBasedChannel { * .catch(console.error); */ 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.'); + return msg; + }); + } return this.client.rest.methods.getChannelMessage(this, messageID).then(data => { const msg = data instanceof Message ? data : new Message(this, data, this.client); this._cacheMessage(msg);