From 0476720a540d80d2043aa430f1d56440606a69e8 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Thu, 3 Mar 2022 14:26:21 -0500 Subject: [PATCH] Fix Command-Not-Found-ing --- src/games/hvacoins/index.js | 5 ++++- src/games/index.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/games/hvacoins/index.js b/src/games/hvacoins/index.js index 9ce63bd..45c37d2 100644 --- a/src/games/hvacoins/index.js +++ b/src/games/hvacoins/index.js @@ -126,8 +126,11 @@ command( slack.onMessage(async ({ event, say }) => { const words = event?.text?.split(/\s+/) || [] const c = commands.get(words[0]) + if (!words[0]?.startsWith('!')) { + return + } if (!c?.condition(event.user)) { - await say(`Command '${words[0]} not found'`) + await say(`Command '${words[0]}' not found`) return } if (words[1] === 'help') { diff --git a/src/games/index.js b/src/games/index.js index 20b5b85..803dca8 100644 --- a/src/games/index.js +++ b/src/games/index.js @@ -1,4 +1,4 @@ require('./connect4') require('./tictactoe') require('./jokes') -require('./coins') \ No newline at end of file +require('./hvacoins') \ No newline at end of file