• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

EN User Blacklist Script

Status
Not open for further replies.

Infiniti

Member
I've recently came into a problem where users keep on coming into my channel, spamming their mics and the chat with inappropriate things. We aren't allowed to have passwords/talk power in our channels on my TS server, and I don't have the ability to ban users, so the best I can do is repeatedly kick them whenever this happens. I thought it would be a great idea to have a sort of blacklist that you can add users to.

Basically how it would work is you use the command !blacklist <user>, and then it will write the userid tied to that username into a text file.

Whenever a user joins the channel, it will check the text document to see if that userid is blacklisted, and if so, then it will automatically kick the user.

So what the script needs to do is:
-get the userid of a username
-write to a text file
-detect what userids join the channel
-read from a text file
-input a kick user from channel command
 

Infiniti

Member
But with that I have to manually add the client ids into the code? Or is there a command I can use such as !blacklist <userid>?
 

kanalumaddela

Insider
Insider
But with that I have to manually add the client ids into the code? Or is there a command I can use such as !blacklist <userid>?
Manually. As far as I know (and someone correct me if I'm wrong), there isn't a way to kick users from the channel based off their unique id. You can only kick from channel using the client id which changes every time on reconnect. You also can't kick based off of keywords from a user's name because the bot can't check for that. Although I do know that @Multivitamin 's jail script had a feature where you can do something like !jail <name> which idk how it was accomplished.
 

Infiniti

Member
I have always hated how god-awful TS's command and permission system is.. So basically all they have to do is disconnect from the server and reconnect and they will no longer be on the blacklist?
 

kanalumaddela

Insider
Insider
I have always hated how god-awful TS's command and permission system is.. So basically all they have to do is disconnect from the server and reconnect and they will no longer be on the blacklist?
No, the script I suggested saves the unique IDs in the settings.
 

Infiniti

Member
Manually. As far as I know (and someone correct me if I'm wrong), there isn't a way to kick users from the channel based off their unique id. You can only kick from channel using the client id which changes every time on reconnect. You also can't kick based off of keywords from a user's name because the bot can't check for that. Although I do know that @Multivitamin 's jail script had a feature where you can do something like !jail <name> which idk how it was accomplished.

I put my unique ID into the bot though and it kicks me when I try and join the channel. And why would the script save unique IDs then if they can't be used to kick users?

Edit: I tried to add this code below the clientMove function:

Code:
sinusbot.on('chat', function(ev) {
    if (ev.msg != "!blacklist") return;
    var userid = ev.msg.split(" ")[1];
    config.clientUids += "," + userid;
});

as an attempt to add users to the config through a command, as opposed to going all the way to the website. It didn't really work, and I'm sure I'm doing everything completely wrong.. so yeah idk. Happen to know if anything like this could work?
 
Last edited:
Status
Not open for further replies.
Top