Bots Home
|
Create an App
allinoneellipses
Author:
ellipsis
Description
Source Code
Launch Bot
Current Users
Created by:
Ellipsis
const spamlist = ['jungs', '\ud835', '(delete','space)','boy4y', '. fun', 'er hospital', 'b0ys','b0yz','<-','\u2192','\uffeb','\u2b62','\u0362','boyzz','boyz','c2c','seeme','see my','check my', 'check me', 'checkme','seemy','cam 2 cam','.club','. club','. us','. tk','. pw', '. me', '.us', '.tk', 'checkmy', 'c 2 c', 'c 2c', 'c2 c', 'checkmy', 'cam2cam', '.me', '.pw', '-->']; const spamlist2 = ['my pretty','i wanna cum so bad','\udE95','see my nice ass','my dirty ass so horny','masturbate with me','my pinky ass','sluttie girl', 'jerk off with me', 'fucking kitten','i am dirty', 'i wanna squirt so bad', 'i want to squirt so bad','i\'m kinky girl', 'im so horny','i want to cum so bad.', 'im horny', 'i\'m very','im bad', 'im very', 'my slutty pussy','im very sluttie', 'i am horny','on me','am sexy','im sexy','cum on me','pee on me','see me', 'naughty', 'about to cum', 'watch', '\ud83d','\udc4c','view my', 'look at me','wollen', 'sie', '.live', 'boy4y', '. fun', 'google','giveaway','jungen','schauen','konto','meine','lady','<','>','kitty', 'join','url','site','view','visit','boys','guys','boyz','boyzz','page','bio','check','account','profile','heisse', 'haben', 'guten']; const spamemail = 'Hi there,\nI\'m writing because I use a spam filter when I broadcast and the developer added a function that records the usernames of accounts that are caught by it, and wanted to give broadcasters the option to report them to Chaturbate. Here is a comma separated list of users that were picked up by the most accurate part of the filter. Please note that it\'s not 100% accurate, but if a user is reported multiple times, it is most likely a bot. A shadowban would be the most effective way to cut down on the spam. This message was generated by one of ellipsis2198\'s bots.'; var wordlist = ['deadbeef']; var userlist = ['deadbeef']; var spammerlist = []; var harasserlist = []; var harassertimer = []; var harassertimeout = 75; var enabled = true; var antiharass = false; var tipmenu = []; var notices = []; var currentNotice = 0; var tipmenuStr = ''; var tipcompare = []; var tipmenuid = 0; var msgcounter = 0; var res; const delims = {'Heart':'\u2665', 'Spade':'\u2660', 'Sun':'\u2600', 'Coffee':'\u2615', 'Smile':'\u263b', 'Dot':'\u26ab', 'Star':'\u2605', 'Yin/Yang':'\u262f', 'Eighth Note':'\u266a', 'Aries':'\u2648', 'Taurus':'\u2649', 'Gemini':'\u264a', 'Cancer':'\u264b', 'Leo':'\u264c', 'Virgo':'\u264d', 'Libra':'\u264e', 'Scorpius':'\u264f', 'Sagittarius':'\u2650', 'Capricorn':'\u2651', 'Aquarius':'\u2652', 'Pisces':'\u2653'}; cb.settings_choices = [ {name:'dontuse', type:'choice', choice1: '-------', label:"Welcome. Note that you only need to use the fields marked with an asterisk (*)."}, {name:'tmcolor',type:'str',defaultValue:'#9900ff',label:'HTML Color Code for chat notice text, good picker here https://www.w3schools.com/colors/colors_picker.asp - Default is purple.'}, {name:'notify', type:'choice',choice1:'No',choice2:'Yes', defaultValue:'Yes', label: "Receive a notification when automoderator filters a word/user from the list?"}, {name:'antiharassment', type:'choice', choice1: 'Yes', choice2: 'No', defaultValue:'No', label:"Prevent grey users from talking for a period after joining to counter harassers with alt accounts?"}, {name:'nogreys', type:'choice', choice1: 'Yes', choice2: 'No', defaultValue:'No', label:"Mute grey users altogether"}, {name:'tipmenuenable',type:'choice', choice1: 'Yes', choice2: 'No', defaultValue:'Yes', label:"Enable Tip Menu?"}, {name:'tipmenudelim', type:'choice', choice1:'Heart', choice2:'Spade', choice3:'Sun', choice4:'Coffee', choice5:'Smile', choice6:'Dot', choice7:'Star', choice8:'Yin/Yang', choice9:'Eighth Note', choice10:'Aries', choice11:'Taurus', choice12:'Gemini', choice13:'Cancer', choice14:'Leo', choice15:'Virgo', choice16:'Libra', choice17:'Scorpius', choice18:'Sagittarius', choice19:'Capricorn', choice20:'Aquarius', choice21:'Pisces', defaultValue:'Spade', label: "Set what character separates items in the tip menu."}, {name:'tm1',type:'str',required:false,label:'Tip Menu Item 1: Start with a number, then a space, then the text: eg \"10 PM.\" Don\'t worry about putting formatting like -- or anything, code handles that.'}, {name:'tm2',type:'str',required:false,label:'Tip Menu Item 2'}, {name:'tm3',type:'str',required:false,label:'Tip Menu Item 3'}, {name:'tm4',type:'str',required:false,label:'Tip Menu Item 4'}, {name:'tm5',type:'str',required:false,label:'Tip Menu Item 5'}, {name:'tm6',type:'str',required:false,label:'Tip Menu Item 6'}, {name:'tm7',type:'str',required:false,label:'Tip Menu Item 7'}, {name:'tm8',type:'str',required:false,label:'Tip Menu Item 8'}, {name:'tm9',type:'str',required:false,label:'Tip Menu Item 9'}, {name:'tm10',type:'str',required:false,label:'Tip Menu Item 10'}, {name:'tm11',type:'str',required:false,label:'Tip Menu Item 11'}, {name:'tm12',type:'str',required:false,label:'Tip Menu Item 12'}, {name:'tm13',type:'str',required:false,label:'Tip Menu Item 13'}, {name:'tm14',type:'str',required:false,label:'Tip Menu Item 14'}, {name:'tm15',type:'str',required:false,label:'Tip Menu Item 15 (note: you can add more with commands)'}, {name:'tminterval',type:'int',minValue:1,maxValue:60, defaultValue:2, label:'How often to send tip menu in chat (minutes)'}, {name:'notifierenable', type:'choice', choice1: 'Yes', choice2: 'No', defaultValue:'Yes', label:"Enable Rotating Notifier?"}, {name:'noticecolor', type:'str',required:true,defaultValue:'#0000ff',label:'HTML Color Code for chat notice text, good picker here https://www.w3schools.com/colors/colors_picker.asp - Default is blue.'}, {name:'notice1',type:'str',required:false,label:'Rotating Notice 1 (i.e. "Instagram: *link to instagram*" or ":Amazon Wishlist: *link to wishlist*'}, {name:'notice2',type:'str',required:false,label:'Rotating Notice 2'}, {name:'notice3',type:'str',required:false,label:'Rotating Notice 3'}, {name:'notice4',type:'str',required:false,label:'Rotating Notice 4'}, {name:'notice5',type:'str',required:false,label:'Rotating Notice 5'}, {name:'notice6',type:'str',required:false,label:'Rotating Notice 6'}, {name:'notice7',type:'str',required:false,label:'Rotating Notice 7'}, {name:'notice8',type:'str',required:false,label:'Rotating Notice 8'}, {name:'notice9',type:'str',required:false,label:'Rotating Notice 9'}, {name:'notice10',type:'str',required:false,label:'Rotating Notice 10 (note: you can add more with commands)'}, {name:'noticeinterval',type:'int',minValue:1,maxValue:60, defaultValue:2, label:'How often to send notices in chat (minutes)'}, {name:'antibotspam',type:'choice', choice1: 'Yes', choice2: 'No', defaultValue:'Yes', label:'Prevent the tip menu/notifier from spamming chat if it\'s slow?'}, {name:'additionalnotice', type:'choice', choice1:'No',choice2:'Yes', defaultValue:'No', label:'Send you notices for when grey users enter/leave? (hint: don\'t enable this in a popular room.)'}, ]; //init tip menu if (cb.settings.tipmenuenable == 'Yes') { if(cb.settings.tm1){tipmenu.push(parseTipMenuItem(cb.settings.tm1));} if(cb.settings.tm2){tipmenu.push(parseTipMenuItem(cb.settings.tm2));} if(cb.settings.tm3){tipmenu.push(parseTipMenuItem(cb.settings.tm3));} if(cb.settings.tm4){tipmenu.push(parseTipMenuItem(cb.settings.tm4));} if(cb.settings.tm5){tipmenu.push(parseTipMenuItem(cb.settings.tm5));} if(cb.settings.tm6){tipmenu.push(parseTipMenuItem(cb.settings.tm6));} if(cb.settings.tm7){tipmenu.push(parseTipMenuItem(cb.settings.tm7));} if(cb.settings.tm8){tipmenu.push(parseTipMenuItem(cb.settings.tm8));} if(cb.settings.tm9){tipmenu.push(parseTipMenuItem(cb.settings.tm9));} if(cb.settings.tm10){tipmenu.push(parseTipMenuItem(cb.settings.tm10));} if(cb.settings.tm11){tipmenu.push(parseTipMenuItem(cb.settings.tm11));} if(cb.settings.tm12){tipmenu.push(parseTipMenuItem(cb.settings.tm12));} if(cb.settings.tm13){tipmenu.push(parseTipMenuItem(cb.settings.tm13));} if(cb.settings.tm14){tipmenu.push(parseTipMenuItem(cb.settings.tm14));} if(cb.settings.tm15){tipmenu.push(parseTipMenuItem(cb.settings.tm15));} cb.log(tipmenu); cb.log(delims); initTipMenu(); } if (cb.settings.notifierenable == 'Yes') { if(cb.settings.notice1){notices.push(cb.settings.notice1);} if(cb.settings.notice2){notices.push(cb.settings.notice2);} if(cb.settings.notice3){notices.push(cb.settings.notice3);} if(cb.settings.notice4){notices.push(cb.settings.notice4);} if(cb.settings.notice5){notices.push(cb.settings.notice5);} if(cb.settings.notice6){notices.push(cb.settings.notice6);} if(cb.settings.notice7){notices.push(cb.settings.notice7);} if(cb.settings.notice8){notices.push(cb.settings.notice8);} if(cb.settings.notice9){notices.push(cb.settings.notice9);} if(cb.settings.notice10){notices.push(cb.settings.notice10);} initNotifier(); } //rotations if (cb.settings.tipmenuenable == 'Yes') {printTipMenuRepeat();} if (cb.settings.antiharassment == 'Yes') {antiharass = true;} cb.onEnter(function(user) { //first tip menu if (cb.settings.tipmenuenable == 'Yes') {cb.sendNotice(tipmenuStr,user['user'],'',cb.settings.tmcolor,'bold');} //grey user notifier if ((cb.settings.additionalnotice == 'Yes') && !user['has_tokens']) {cb.sendNotice("" + user['user'] + " (" + user['gender'] + ") has entered the room.",cb.room_slug, '', '#02FF43', 'bold');} if (antiharass) { harasserlist.push(user['user']); cb.setTimeout(reduceTimeout(harasserlist.length-1), (harassertimeout * 1000)); } }); cb.onLeave(function(user) { if ((cb.settings.additionalnotice == 'Yes') && !user['has_tokens']) {cb.sendNotice("" + user['user'] + " (" + user['gender'] + ") has left the room.",cb.room_slug, '', '#FF4141', 'bold');} }); cb.onTip(function (tip) { for (i=0; i<tipmenu.length; ++i) { if (parseInt(tip['amount']) == tipmenu[i][0]) { cb.sendNotice(tip['from_user'] + " tipped for " + tipmenu[i][1], '', '', cb.settings.tmcolor,'bold'); cb.sendNotice("Thank you, " + tip['from_user'] + "!", '','', cb.settings.tmcolor,'bold'); } } }); function reduceTimeout(index) { return harasserlist = harasserlist.splice(index, 1); } function parseTipMenuItem(item) { var cost, actualItem; cost = parseInt(item.match(/\d+/)[0]); actualItem = item.replace(/^\d+\s*/, ''); return ([cost,actualItem]); } function initTipMenu() { tipmenu.sort(function(a, b) {return a[0]-b[0]; }); tipmenuStr = ''; tipcompare = []; var iterator = tipmenu.keys(); cb.log(tipmenu); for (i = 0; i < tipmenu.length; ++i) { tipmenuStr +=(tipmenu[i][1] + ": " + tipmenu[i][0] + " " + delims[cb.settings.tipmenudelim] + " "); // PM: 5 | cb.log(tipmenuStr); tipcompare.push((tipmenu[i][1]).toLowerCase()); } } function printTipMenu() { cb.sendNotice(tipmenuStr,'','',cb.settings.tmcolor,'bold'); } function printTipMenuRepeat() { if ((cb.settings.antibotspam == 'Yes') && ((msgcounter != 0) && msgcounter < 7)) { tipmenuid = cb.setTimeout(printTipMenuRepeat, (cb.settings.tminterval * 60000)); return; } msgcounter = 0; cb.sendNotice(tipmenuStr,'','',cb.settings.tmcolor,'bold'); tipmenuid = cb.setTimeout(printTipMenuRepeat, (cb.settings.tminterval * 60000)); } function initNotifier() { if ((cb.settings.antibotspam == 'Yes') && ((msgcounter != 0) && msgcounter < 7)) { cb.setTimeout(initNotifier, (cb.settings.noticeinterval * 60000)); return; } msgcounter = 0; if (currentNotice == notices.length) {currentNotice = 0;}; cb.sendNotice(notices[currentNotice],'','',cb.settings.noticecolor,'bold'); currentNotice++; cb.setTimeout(initNotifier, (cb.settings.noticeinterval * 60000)); } function longer(champ, contender) { return (contender.length > champ.length) ? contender: champ; } function longestWord(str) { var words = str.split(' '); return words.reduce(longer); } cb.onMessage(function (msg) { /* if(!enabled) { return msg; } */ if ((msg['user'] == cb.room_slug) || (msg['is_mod'])) { if (msg['m'].startsWith('/spamemail')) { msg['X-Spam'] = true; cb.sendNotice('Copy and paste the message below into an email to support@chaturbate.com\n\n' + spamemail + '\n' + spammerlist, msg['user'], '', '#2AFF00'); return msg; } if (msg['m'].startsWith('/tipmenuadd')) { msg['X-Spam'] = true; let toAdd = msg['m'].substring(12); tipmenu.push(parseTipMenuItem(toAdd)); initTipMenu(); cb.sendNotice('Tip menu updated.', msg['user']); return msg; } if (msg['m'].startsWith('/noticeadd')) { msg['X-Spam'] = true; let toAdd = msg['m'].substring(11); notices.push(toAdd); cb.sendNotice('Tip menu updated.', msg['user']); return msg; } if (msg['m'].startsWith('/antiharass')) { msg['X-Spam'] = true; if (!antiharass) { antiharass = true; cb.sendNotice('Anti harassment enabled.', msg['user']); } else { antiharass = false; cb.sendNotice('Anti harassment disabled.', msg['user']); } return msg; } /*if (msg['m'].startsWith('/filteron')) { msg['X-Spam'] = true; cb.sendNotice('The filter has been enabled.', msg['user'], '', '#2AFF00'); enabled = true; return msg; } if (msg['m'].startsWith('/filteroff')) { msg['X-Spam'] = true; cb.sendNotice('The filter has been disabled.', msg['user'], '', '#FF0000'); enabled = false; return msg; } */ if (msg['m'].startsWith('/sbwlist')) { msg['X-Spam'] = true; cb.sendNotice('/sbw ' + wordlist.valueOf(), msg['user'], '', '#2AFF00'); return msg; } if (msg['m'].startsWith('/sblist')) { msg['X-Spam'] = true; cb.sendNotice('/sb ' + userlist.valueOf(), msg['user'], '', '#2AFF00'); return msg; } if (msg['m'].startsWith('/sbrw')) { msg['X-Spam'] = true; if (msg['m'].length <= 7) { cb.sendNotice('Error: no argument. Please type a word after the command.', msg['user'], '', '#9000FF'); return msg; } wordlist[wordlist.indexOf(msg['m'].substring(6))] = ''; cb.sendNotice('The word has been removed from the blacklist.', msg['user'], '', '#FF0000'); return msg; } if (msg['m'].startsWith('/sbr')) { msg['X-Spam'] = true; if (msg['m'].length <= 6) { cb.sendNotice('Error: no argument. Please type a username after the command.', msg['user'], '', '#9000FF'); return msg; } userlist[userlist.indexOf(msg['m'].substring(5))] = ''; cb.sendNotice('The user has been removed from the blacklist.', msg['user'], '', '#FF0000'); return msg; } if (msg['m'].startsWith('/sbw')) { msg['X-Spam'] = true; if (msg['m'].length <= 6) { cb.sendNotice('Error: no argument. Please type a word after the command.', msg['user'], '', '#9000FF'); return msg; } if (msg['m'].charAt(msg['m'].length - 1) == ',') { cb.log("List contains a trailing comma: " + msg['m']); res = msg['m'].substring(0,msg['m'].length-1); cb.log("Removed comma: " + res); userlist.push(...(res.substring(5).split(','))); cb.log("new userlist: " + userlist); } else { wordlist.push(...(msg['m'].substring(5).split(','))); } cb.sendNotice('Word(s) added to filter.', msg['user'], '', '#2AFF00'); return msg; } if (msg['m'].startsWith('/sb')) { msg['X-Spam'] = true; if (msg['m'].length <= 4) { cb.sendNotice('Error: no argument. Please type a username after the command.', msg['user'], '', '#9000FF'); return msg; } if (msg['m'].charAt(msg['m'].length - 1) == ',') { res = msg['m'].substring(0,msg['m'].length-1); userlist.push(...(res.substring(4).split(','))); } else { userlist.push(...(msg['m'].substring(4).split(','))); } cb.sendNotice('User(s) added to filter.', msg['user'], '', '#2AFF00'); return msg; } return msg; } if (msg['m'].startsWith('/tipmenu')) { msg['X-Spam'] = true; cb.sendNotice(tipmenuStr,msg['user'],'',cb.settings.tmcolor,'bold'); return msg; } if ((!msg['has_tokens']) && (cb.settings.nogreys=='Yes')) { msg['X-Spam'] = true; cb.sendNotice("Sorry, greys are muted - buy some tokens and you can chat.",msg['user']); return msg; } //check for phone numbers if((msg['m'].match(/(\+\d{1,2}\s)?\(?\d{3,5}\)?[\s.-]?\d{3,5}[\s.-]?\d{4}$/)) != null) { cb.log('Spam removed. Contents: \"' + msg['m'] + '\"'); spammerlist.push(msg['user']); msg['X-Spam'] = true; //cb.sendNotice('Your message was unable to be sent.', msg['user']); return msg; } //if the list gets real long, will probably add a check for gray/female accounts, as basically //all spam comes from such an account else if((!msg['has_tokens']) && (msg['gender'] != 'm')) { //check regular list if(spamlist.some(spam => msg['m'].toLowerCase().includes(spam))) { cb.log('Spam removed. Contents: \"' + msg['m'] + '\"'); msg['X-Spam'] = true; spammerlist.push(msg['user']); //cb.sendNotice('Your message was unable to be sent.', msg['user']); return msg; } if((msg['m'].length <= 4) && !(msg['m'].includes(' '))) { cb.log('Spam removed. Contents: \"' + msg['m'] + '\"'); spammerlist.push(msg['user']); msg['X-Spam'] = true; //cb.sendNotice('Your message was unable to be sent.', msg['user']); return msg; } if(spamlist2.some(spam => msg['m'].toLowerCase().includes(spam))) { cb.log('Spam removed. Contents: \"' + msg['m'] + '\"'); spammerlist.push(msg['user']); msg['X-Spam'] = true; //cb.sendNotice('Your message was unable to be sent.', msg['user']); return msg; } } //spam check for those stupid '(emoji) Boys' bots, don't iterate if message is large - //application server is trash and this has some rough runtime else if(msg['m'].length < 20) { if (spamlist2.some(spam => longestWord(msg['m']).toLowerCase().includes(spam))) { cb.log('Spam removed. Contents: \"' + msg['m'] + '\"'); spammerlist.push(msg['user']); msg['X-Spam'] = true; //cb.sendNotice('Your message was unable to be sent.', msg['user']); return msg; } } if (antiharass && harasserlist.some(user => msg['user'].toLowerCase().includes(user.toLowerCase()))) { if(cb.settings.notify == 'Yes') { cb.log('harasser list user filtered.'); } msg['X-Spam'] = true; return msg; } if (userlist.some(user => msg['user'].toLowerCase().includes(user.toLowerCase()))) { if(cb.settings.notify == 'Yes') { cb.log('Shadowbanned user filtered.'); cb.sendNotice('The user ' + msg['user'] + ' tried to send a message, but is on the user blacklist.' , cb.room_slug, '', '#33AAFF'); } msg['X-Spam'] = true; return msg; } if (wordlist.some(word => msg['m'].toLowerCase().includes(word))) { if(cb.settings.notify == 'Yes') { cb.log('Shadowbanned word filtered.'); cb.sendNotice('The user ' + msg['user'] + ' tried to send a message, but used a word on the blacklist.' , cb.room_slug, '', '#33AAFF'); } msg['X-Spam'] = true; return msg; } //check for item in tipmenu if (tipcompare.some(item => msg['m'].toLowerCase().includes(item))) { cb.sendNotice("Hey " + msg['user'] + ", this item's in the tip menu. Check it out with /tipmenu.",'','',cb.settings.tmcolor,'bold'); cb.sendNotice(tipmenuStr,msg['user'],'','',cb.settings.tmcolor,'bold'); return msg; } if ((cb.settings.antibotspam == 'Yes') && ((cb.settings.tipmenuenable == 'Yes') || (cb.settings.notifierenable == 'Yes'))) msgcounter++; return msg; });
© Copyright Chaturbate 2011- 2024. All Rights Reserved.