Triggering another command within a command based on a keyword

Asked Oct 18, 2020·1 reply·Last activity 5 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Hi,

Not sure if it's possible cause I'm having nothing but problems but I'm trying to make a command as people frequently ask how to request a song or if the streamer is still accepting them etc.

The command would take the starting word so "can" "is" "are" "how" (one command for each word) and if there is the word "request" within the string then it triggers the !how command, informing the person that said it how to request a song.

I found this bit of code and modified it !commands add how $(eval $(query).toLowerCase().includes("request") ? "Request Present" : ) which shows "Request Present" if it's there and doesn't do anything if it's not. However when I change "Request Present" to the command !how it says that how is not defined I have also tried and IF statement but can't quite figure it out as it repeatedly errors out.

I'm beginning to think what I'm trying to do isn't actually possible within Nightbot ha.

1 reply

Set the alias of the command to !how and make !how look like this:

$(eval `$(query)`==`Request Present`?`!HOW_RESPONSE`:` `)