Fix Command-Not-Found-ing
This commit is contained in:
parent
aadb57ecb5
commit
0476720a54
|
@ -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') {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require('./connect4')
|
||||
require('./tictactoe')
|
||||
require('./jokes')
|
||||
require('./coins')
|
||||
require('./hvacoins')
|
Loading…
Reference in New Issue