Skip to content

Commit

Permalink
fix(Message): add throw
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed May 21, 2024
1 parent 76d01ca commit 07aa297
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/discord.js/src/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ class Message extends Base {
async fetchReference() {
if (!this.reference) throw new DiscordjsError(ErrorCodes.MessageReferenceMissing);
const { channelId, messageId } = this.reference;
if (!messageId) throw new DiscordjsError(ErrorCodes.MessageReferenceMissing);
const channel = this.client.channels.resolve(channelId);
if (!channel) throw new DiscordjsError(ErrorCodes.GuildChannelResolve);
const message = await channel.messages.fetch(messageId);
Expand Down

0 comments on commit 07aa297

Please sign in to comment.