Bots Home
|
Create an App
test grPHICS
Author:
utgvjkhljn
Description
Source Code
Launch Bot
Current Users
Created by:
Utgvjkhljn
var MAX_REASONS = 9; var MAX_CHECKS = 11; var EnterMsg = ''; mutereasons = [ {regexp: /:\b/, notice: 'graphics', index: 1} ] cb.settings_choices = [ {name: 're1', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute graphics?"}, ]; function onEnterMsg(){ var EnterMsg=''; for (i=0; i<= MAX_REASONS; i++) { if (cb.settings['re' + i] == 'yes'){ EnterMsg += 'No ' + mutereasons[i].notice + ', '; } } return EnterMsg; } function checkmsg(msg) { var i, tmpmsg, reason, mutemsg; mutemsg = false; if ((!msg['has_tokens']) && (!msg['is_mod']) && (!msg['in_fanclub']) && (!is_broadcaster(msg))) { for (i=0; i<= MAX_CHECKS; i++) { if (i==4) { tmpmsg = tmpmsg.replace(/\s+/g, ''); } else { tmpmsg = msg['m']; } if ((tmpmsg.search(mutereasons[i].regexp) != -1) && (cb.settings['re' + mutereasons[i].index] == 'yes')){ mutemsg = true; reason = mutereasons[i].notice; } } if (mutemsg == true) { msg['m'] = "*** Muted for " + reason + " ***"; if (cb.settings['mutehide'] == 'hide') { msg['X-Spam'] = true; cb.chatNotice('Your msg was hidden from chat',msg['user'],'','','bold'); } } } } function is_broadcaster(msg) { return (msg['user'] == cb.room_slug); } function init() { if (cb.settings['sendrules'] == 'yes') { EnterMsg = onEnterMsg(); } } cb.onMessage(function (msg) { checkmsg(msg); return msg; }); init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.