Skip to content

Commit

Permalink
fix(bot/autorecord): ensure recording has proper state on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Oct 27, 2024
1 parent 760848d commit 30f1cb4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/bot/src/modules/autorecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,11 @@ export default class AutorecordModule extends DexareModule<DexareClient<CraigBot
);
reportAutorecordingError(member, guildId, channelId, error, recording);

recording.state = RecordingState.ERROR;
await recording.stop(true).catch(() => {});
if (recording.state !== RecordingState.ERROR) {
recording.state = RecordingState.ERROR;
await recording.stop(true).catch(() => {});
}

if (recording.messageID && recording.messageChannelID)
await this.client.bot
.editMessage(recording.messageChannelID, recording.messageID, {
Expand Down

0 comments on commit 30f1cb4

Please sign in to comment.