Detect is there's anything after the command

Asked Jun 9, 2020·4 replies·Last activity 6 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.

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 "❌ Add something to love!".

Example:
!love
❌ Add something to love!

!love lemons
There's $(urlfetch https://beta.decapi.me/random/number/1/100)% ❤ between $(user) & $(query)

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

x.pngheart.png

4 replies

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

I want it to say "❌" 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 "❌", if there is something after the !love. For example: !love ice cream, it would say the command.

x.png

Hey @Nutty Hippo!

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.`;)

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

heart.png