I have basic knowledge in programming but not in this language. So can someone help me to program a command where if the argument next to the command is e.g. "NAME", I output "Hello NAME". But NAME can be something different than the author of the message?
How to print second argument if it is a specific word
6 replies
Hey @Stellar Fox!
Nightbot uses JavaScript, but for simple commands like yours text is more than enough!
With the description you've given, I think what you're looking for is the $(touser) variable.
With a command like this one:
!addcom !hello Hello $(touser)!
The bot will answer like this:
aUser1: !helloNightbot: Hello User1!User1: !hello User2Nightbot: Hello User2!
Could this be what you're looking for then?
/t/nighbot-responding-to-a-sentence-command-name-with-space/15346363392306709…
If not, please provide an example like I explained how the bot would answer.
Didn't find your answer? The community is on Discord.
Ask on Discord