I'm looking to make a command that automatically pops up when someone says a certain word or phrase? Is this possible?
How to make call on command?
3 replies
@Silky Tiger Hm, could be possible.
!addcom -cd=5 YOUR_CERTAIN_WORD YOUR_COMMAND_RESPONSE
Ex.
!addcom -cd=5 ritik Thanks for admiring <3
Usage:
Ritik: ritik is greatNightbot: Thanks for admiring <3Ritik: ritik is dump developerNightbot: Thanks for admiring <3Ritik: My name is Ritik... *No response*
Also the phrase thing is not actually possible. As all the commands are trigger with first argument only.
But there is a way. Kinda
!addcom -cd=5 FIRST_WORD $(eval `$(query)`.toLowerCase()==`YOUR_REST_OF_THE_SENTENCE`.toLowerCase()?`COMMAND_RESPONSE`:` `)
Ex.
!addcom -cd=5 ritik $(eval `$(query)`.toLowerCase()==`is great`.toLowerCase()?`Thank you <3`:`No u`)
Usage
Ritik: ritik is greatNightbot: Thank you <3Ritik: ritik is noobNightbot: No uRitik: ritik ranjan is his full nameNightbot: No u
Hope it helps
Regards
Here’s a more general format. For a phrase
!addcom First_Word_of_Phrase $(eval `$(query)`.toLowerCase()==`Rest_Of_Phrase`.toLowerCase()?`Response_If_Match`:`Response_If_Not_Match`)
If you don’t want it to say anything when it doesn’t match leave it as \ \
For a word you can just do:
!addcom Word Response
I hope that’s clear if not please explain what you don’t understand