Changing permissions with a command

Asked Oct 26, 2020·7 replies·Last activity 5 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.

There's a command I have enabled that posts a wall of text, but I only want it to be available when I manually enable/disable it to prevent spam. Is there a command I can add which allows me to turn it on or off without completely removing it every time? Preferably enable/disable toggle or live userlevel changes, or both if possible.

7 replies

Hey @Plaid Squid!

By editing the userlevel to owner it'll somewhat disable it for everyone except you, so that's what we're gonna do, you'll need to create two more commands for that tho':

!addcom !COMMAND_NAMEoff -ul=owner -a=!editcom !COMMAND_NAME \-ul=owner
!addcom !COMMAND_NAMEon -ul=owner -a=!editcom !COMMAND_NAME \-ul=everyone

Replace the COMMAND_NAME fields, there are 4, with the name of your command.

do you know how i can say a command that I only have permission to say

If you've already created the command, go to your Nightbot page, to custom commands, and change the userlevel from there. You can also use editcom directly from chat; look at the top line of code on Emily's comment and type everything from !editcom to the end of the line.

Hey @Hearty Ant!

I'm not sure I understand what you're looking for, but if you want to have a command that only you can use, and you're also the owner of the channel, aka streamer, set the userlevel to owner. Else, consider using the moderator userlevel, all moderators will be able to use it, but this shouldn't be an issue.
However, if you really really want a command that only you can use, here's how to do it:

!addcom COMMAND_NAME $(eval `$(user)`.toLowerCase()==`YOUR_USERNAME`.toLowerCase()?`COMMAND_RESPONSE`:` `)

Replace the COMMAND_NAME, YOUR_USERNAME and COMMAND_RESPONSE fields.

Is there a way for one command to change the userlevel of multiple other commands at once?

No, you'll have to update them one at a time.

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

Ask on Discord