Trouble with arguments and $(query)

I’ve been puzzling over how to make this command for hours and have searched the forums to little avail. It should be said I don’t know how to code at all, and have cobbled together what I sorta understood based on example commands + poring over the help docs.

I want to make a fake timeout command. Right now this is what I have:

$(user) timed out $(touser) for $(eval Math.floor((Math.random() * 100))) seconds. Reason: $(2 $(query))

The command is “!jail ”, but with just $(query) by itself it spits out everything after !jail, and with $(2) it only selects the first word after the username. Any insight would be amazing. :frowning:

purdy close actually…

$(user) timed out $(touser) for $(eval a=`$(query)`.split(` `);a.shift();b=Math.floor((Math.random() * 100));`${b} second${b==1?``:`s`}. Reason: ${a.join(` `)}`)

that should do it for ya :wink:

thank you SO much!!! i literally would have never figured this out on my own. :heart: :heart:

1 Like

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