Trouble with arguments and $(query)

Asked Feb 7, 2024·2 replies·Last activity 2 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.

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 <touser here> <reason here>", 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. 😦

2 replies

purdy close actually...

js
$(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 ;)

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