DawnbrandBots/bastion-bot

/rush-duel art: potential unnecessary logging of error if message is deleted before switcher timeout

Closed this issue · 2 comments

parentInteraction
.editReply(this.replyOptions)
.catch(e => this.logger.error(serialiseInteraction(parentInteraction), e));

If the interaction reply is deleted before 60 seconds is up, Bastion will log a DiscordAPIError[10008]: Unknown Message upon attempting to edit the message to disable the buttons, even if they are already disabled due to lack of alt arts. The stack trace does not include first-party code because editReply is not awaited.

Internal examples start from:

There's also a small potential of the parent interaction expiring in 15 minutes while the switcher is being interacted with and is then deleted.

It seems hitting the timeout is not necessary. The interaction being deleted is itself an event that triggers the catcher.

When deleted, the catcher receives an InteractionCollectorError with message 'Collector received no interactions before ending with reason: messageDelete'