Skip to content

Commit

Permalink
πŸ› Fix target message resolving in move command
Browse files Browse the repository at this point in the history
  • Loading branch information
noftaly committed Jun 26, 2024
1 parent 06c2431 commit 4eb8351
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands/basic/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export class MoveCommand extends SwanCommand {
interaction: SwanCommand.ContextMenuInteraction<'cached'>,
_context: ContextMenuCommand.RunContext,
): Promise<void> {
const message = interaction.options.getMessage('message', true);
await this._exec(interaction, message);
if (interaction.isMessageContextMenuCommand()) await this._exec(interaction, interaction.targetMessage);
else throw new Error('This command can only be run in a message context menu.');
}

private async _exec(interaction: SwanCommand.CommandInteraction<'cached'>, targetedMessage: Message): Promise<void> {
Expand Down

0 comments on commit 4eb8351

Please sign in to comment.