Apps Home
|
Create an App
peppery's app
Author:
monster_boyy
Description
Source Code
Launch App
Current Users
Created by:
Monster_Boyy
cb.settings_choices = [ {name:'Warn shouters in public', type:'choice', choice1:'Yes', choice2:'No', defaultValue:'Yes'}, {name:'Hide shouts as spam', type:'choice', choice1:'Yes', choice2:'No', defaultValue:'Yes'}, {name:'Hush shouters to lowercase', type:'choice', choice1:'Yes', choice2:'No', defaultValue:'No'}, {name:'Allow mods to shout', type:'choice', choice1:'Yes', choice2:'No', defaultValue:'No'}, {name:'Allow fan-club to shout', type:'choice', choice1:'Yes', choice2:'No', defaultValue:'No'}, {name:'Allow blues to shout', type:'choice', choice1:'Yes', choice2:'No', defaultValue:'No'} ]; cb.onMessage(function (msg) { if (!fromBroadcaster(msg)) { if (fromMod(msg) && modsPermitted()) { return(msg); } else if (fromFan(msg) && fansPermitted()) { return(msg); } else if (fromBlue(msg) && bluesPermitted()) { return (msg); } if (msg['m'].toUpperCase() == msg['m']) { punish(msg); } } return msg; }); function punish(msg) { if (shouldPubliclyWarn()) cb.sendNotice("No shouting, " + msg['user'] + "!"); else cb.sendNotice("Shh - No shouting, " + msg['user'] + "!", msg['user']); if (shouldHideShouts()) { msg['X-Spam'] = true; } if (shouldModifyMessages()) { msg['m'] = msg['m'].toLowerCase(); } return msg; } function shouldPubliclyWarn() { return (cb.settings['Warn shouters in public'] == 'Yes'); } function shouldHideShouts() { return (cb.settings['Hide shouts as spam'] == 'Yes'); } function shouldModifyMessages() { return (cb.settings['Hush shouters to lowercase'] == 'Yes'); } function modsPermitted() { return (cb.settings['Allow mods to shout'] == 'Yes'); } function fansPermitted() { return (cb.settings['Allow fan-club to shout'] == 'Yes'); } function bluesPermitted() { return (cb.settings['Allow blues to shout'] == 'Yes'); } function fromMod(msg) { return (msg['is_mod']); } function fromFan(msg) { return (msg['in_fanclub']); } function fromBlue(msg) { return (msg['has_tokens']); } function fromBroadcaster(msg) { return msg['user'] == cb.room_slug; }
© Copyright Freesexcam 2011- 2024. All Rights Reserved.