I’m trying to make a command that prints the entire query given or, if no query is given, the command user’s username.
Examples:
!example test → Nightbot: Test is nice! !example → Nightbot: Dimentive is nice!
I’ve tried a few different things but to no avail. It’s going to be an 8-ball-esque command which gives you a random word, so I don’t know how to make this work.
I want to have a command where instead of printing the command user’s username if no query is given, it prints a string of regular text, but I couldn’t get it to work; it just prints nothing but a space if no query is given.
Not sure I follow what you’re saying. Could you paste your command response as is, some screenshots of you testing the command, and what the desired vs actual output of each test case is?
!addcom -cd=5 !hug $(user) $(eval decodeURIComponent(`hugged $(querystring)`)||`hugged… themselves. Awkward`)! $(count) hugs have been given.
This command works with a query, but if no query is given, it doesn’t work.
With query (!hug test), the output is: Dimentive hugged test! 5 hugs have been given.
Without query (!hug), the output is: Dimentive hugged ! 3 hugs have been given.