Bots Home
|
Create an App
ScamBanner
Author:
astralcatt
Description
Source Code
Launch Bot
Current Users
Created by:
Astralcatt
/** Name: ScamBanner Bot Author: bigtittygamerslut Creation Date: 1/28/2019 Live Version: 1.0 Test Version: 1.0 **/ /** Description: This bot wil automatically prevent known scammers from viewing your room or posting in your chat. If you have an issue with someone scamming you, please reach out to Astaria (astariakincaid@gmail.com) with screenshots, and their name will be added to the list. If you have any questions, please reach out to her via email. **/ /** Change Log: 1.0 ... Initial Release **/ //user settings cb.settings_choices = [ {name: 'scamBan', label: 'Would you like to enable the ScamBanner Bot?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'} ] let initialize = 0; let scamArray = ['1393969187', '1993258349']; purple = "#C287C2"; //init { if(initialize == 0){ if(cb.settings.scamBan == 'Yes'){ cb.sendNotice('Known Scammers will no longer be permitted to post in this room.', cb.room_slug, purple) } } } cb.onMessage(function(msg) { if(cb.settings.scamBan == 'Yes'){ if(cbjs.arrayContains(scamArray,msg['user'].hashCode())) { msg['X-Spam'] = true; cb.sendNotice('You have been reported as a scammer and do not have privileges in this room. If you would like to appeal this decision, too bad.',msg['user'],purple); } } }) String.prototype.hashCode = function() { var hash = 0; if (this.length == 0) { return hash; } for (var i = 0; i < this.length; i++) { var char = this.charCodeAt(i); hash = ((hash<<5)-hash)+char; hash = hash & hash; // Convert to 32bit integer } return hash.toString(); }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.