Hello!
I was wondering if there was a way for me to exclude null results from an argument.
Trying to make a !give command
!give @user a hard time
would return: ༼ つ ◕_◕ ༽つ a hard time to :user:
I’ve tried using an argument, but any not used arguments return null.
ie: !give $(2) $(3) $(4) $(5) to $(1) would return: ༼ つ ◕_◕ ༽つ a hard time null null to :user:
Maybe I have to use an $eval ?
Using this command primarily in Discord by the way.
Thanks
1 Like
Have you tried $(query)?
!addcom -cd=5 !give ༼ つ ◕_◕ ༽つ $(query) to $(touser)
query would return the whole phrase though, no?
ie: !give @user a hard time
would return: ༼ つ ◕_◕ ༽つ @user a hard time to @user
1 Like
Ah yes, $(query) does do that. I would use $(eval) to remove the first argument:
!addcom -cd=5 !give ༼ つ ◕_◕ ༽つ $(eval if('$(touser)'!='$(user)'){a=decodeURIComponent('$(querystring)').replace('$(touser)',' ');a.slice(1);a;}else{'Unspecified target!';}) to $(touser)
worked perfectly, thank you!
1 Like
system
closed
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.