Custom commands for specific user

Asked Mar 25, 2020·7 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.

How can I make a custom command only be used by a specific user?

7 replies

There is no actual option to make a command only available for specific users but you can use some eval logic to decide whether to output a response or not.

$(eval `$(user)`==`username here`?`response here`:` `)

yah, I make that:
$(eval $(user) === 'yelloalejo' ? "!bonus $(eval decodeURIComponent($(querystring)).slice(1)|| )" : "No tienes permiso para utilizar este comando CoolCat ")
but I need to add other user, like:
'yelloalejo'||'Naye'
but doesn't work, if I add that, everyone can use the command, I don't know why

To add another user:

$(eval `$(user)`==`user 1`||`$(user)`==`user 2`?`response here`:` `)

hi again, last question... I can add an array of users to compare or i need put:
` || $(user)==newuser ` ?

You can do:

$(eval [`user1`,`user2`,`etc`].includes(`$(user)`)?`response here`:` `)

Didn't find your answer? The community is on Discord.

Ask on Discord