NightDev Community Forums

Doubts about creating spaces in commands

Hi, I have a problem here.

I’m trying to create a command that fetches the username and says what rank of the same in League of legends. I can make the command work, the problem is when the user’s nick has space and is invalid in the command.

I would like to know how I can include spaces in the command without making it invalid.

An example:
command input >>> $(touser) ► $(urlfetch https://api.antonyz.tk/lol/rank?name=$(touser)&r=BR&lang=en )

!rank MyName

Command Response >>> MyName ► GOLD III (84 PDL)

The problem is when the user tries to put a nick with a space.

Example:

!rank My Name Jhon

I tried to put it in the following ways:

!rank My_Name_Jhon
!rank (My Name Jhon)

And no way I can solve it. I’m having the same problem to create other commands, I believe it’s something very simple but as I’m starting, for me it’s a big problem.

Simplest solution is to just use $(querystring) instead of $(touser)

1 Like