Detect is there's anything after the command

Good day! I’m fiddling with the love command and wondering if it’s possible to have the command response if there’s a word after !love and if it’s none, it would say “:x: Add something to love!”.

:x: Add something to love!

!love lemons
There’s $(urlfetch :heart: between $(user) & $(query)

The current command is above. Is this possible? Thank you!

Are you wanting that to be a random API call thing? Because you could just do this… maybe?

!addcom !love $(query) is/are something to love!

Otherwise I’m not exactly sure what you’re wanting

1 Like

I want it to say “:x:” if they just did !love instead of doing !love (something).
It basically detects if something is on the other side of !love, if there isn’t anything then it will say “:x:”, if there is something after the !love. For example: !love ice cream, it would say the command.

Hey @With_Vince!

Here’s how to do it:

!addcom !love $(eval r=Math.floor(Math.random()*100+1); q=decodeURIComponent(`$(querystring)`); `$(query)`?`There's ${r}% :heart: between $(user) and ${q}!`:`:x: Add something to love.`;)
1 Like

Works perfectly! Thank you very much! All I wanted in life. :heart:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.