From 848afcf5d8690dd3a83f39434af5659be3418c11 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Wed, 23 Mar 2022 16:30:32 -0500 Subject: [PATCH] Remove override button after usage --- src/commands/train.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/train.ts b/src/commands/train.ts index b9c5145..ff1227b 100644 --- a/src/commands/train.ts +++ b/src/commands/train.ts @@ -168,9 +168,10 @@ export async function execute(interaction) { filter: overrideFilter, }) .then(i => { - updateScore(true, score, authorId).then((msgToReply) => - i.reply(msgToReply), - ); + updateScore(true, score, authorId).then(async msgToReply => { + await i.reply(msgToReply); + overrideMsg.edit({ components: [] }); + }); }).catch(err => log({ logger: 'train', content: `Failed to override score: ${err}`, level: 'error' })); }).catch(err => log({ logger: 'train', content: `Failed to send override message: ${err}`, level: 'error' })); }