Skip to content

Commit

Permalink
Merge pull request #32 from pattyjogal/CYP-31
Browse files Browse the repository at this point in the history
Follow up message deletes in tenmans cmds with null assign
  • Loading branch information
JoshSanch authored Oct 1, 2021
2 parents 1d14708 + 23b4422 commit a9eab41
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commands/tenmans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class VoteQueueButtonAction extends VoteQueueAction<ButtonInteraction> {

if (tenmansQueue.length >= botConfig.minVoteCount) {
// Generate proper interactable queue once min votes reached
await activeVoteMessage.delete();
await activeVoteMessage?.delete();
voteClosingTime = null;
activeVoteMessage = null;

Expand Down Expand Up @@ -293,6 +293,7 @@ class TenmansCloseSubcommand extends MessageExecutable<CommandInteraction> {
// Teardown - clear current queue
tenmansQueue = [];
await activeTenmansMessage?.delete();
activeTenmansMessage = null;
}
}

Expand Down Expand Up @@ -495,6 +496,7 @@ export async function handleVoteCleaning() {
// Close vote if it has expired
if (voteClosingTime < new Date()) {
await activeVoteMessage.delete();
activeVoteMessage = null;

tenmansQueue = [];
voteClosingTime = null;
Expand Down

0 comments on commit a9eab41

Please sign in to comment.