Bots Home
|
Create an App
Testapp for Banning Bots
Author:
xmedia3
Description
Source Code
Launch Bot
Current Users
Created by:
Xmedia3
function init() { cb.settings_choices = [{ name: 'notify_user', label: 'Notify user if message got banned?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'notify_user_at_join', label: 'Notify user about this bot?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'language', label: 'Language', type: 'choice', choice1: 'EN', choice2: 'DE', defaultValue: 'EN' } ]; // Language Construct Array // 1 = Welcome // 2 = Info about this app // 3 = Debug-Msg for detecting Spam // 4 = Info for user about removing message if (cb.settings.language == 'EN') { var language = ["Welcome to my room ", "!\n This room is running a automatic system to prevent spam.", "Banned string detected", "Your message was deleted due to blacklist."] } if (cb.settings.language == 'DE') { var language = ["Willkommen in meinem Raum ", "!\n Dieser Raum verwendet einen Spam-Schutz.", "Gesperrte Nachricht entdeckt", "Deine Nachricht wurde als Spam erkannt und geloescht."] } cb.onEnter(function (user) { if (cb.settings.notify_user_at_join == 'Yes') { cb.sendNotice(language[1] + user['user'] + language[2]) } }) cb.onMessage(function (msg) { if (msg['is_mod'] == 'True') { return msg; } var n = msg['m']; var blacklist = ["c2c", "visit my room", "Schauen Sie meinen Raum"]; var blacklistlength = blacklist.length; for (var i = 0; i < blacklistlength; i++) { if (n.match(blacklist[i])) { cb.log(language[3]) cb.log("Language: " + cb.settings.language) if (cb.settings.notify_user == 'Yes') { cb.sendNotice(language[4], msg['user'], "#ff0000", "#fff", "bold"); } msg['X-Spam'] = true; } } return msg; }) } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.