Skip to content

Commit a798adc

Browse files
CommandMCbgianfo
authored andcommitted
QuoteCommand: Fetch the message through the interaction's channel
Instead of trying to fetch a message with the ID of the application command (?) just to then use it to get to its channel, we can just use the channel on our interaction
1 parent a75f499 commit a798adc

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/commands/quoteCommand.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,10 @@ export class QuoteCommand extends Command {
159159
};
160160
}
161161

162-
const originalMessage = await interaction.channel?.messages.fetch(interaction.commandId);
163-
if (!originalMessage) return;
164-
165162
// Option 3b: The quote's message ID was given
166163
try {
167-
const message = await originalMessage.channel.messages.fetch(argument);
168-
if (message.guild == null) return;
164+
const message = await interaction.channel?.messages.fetch(argument);
165+
if (message?.guild == null) return;
169166
return {
170167
guildId: message.guild.id,
171168
channelId: message.channel.id,

0 commit comments

Comments
 (0)