Bots Home
|
Create an App
Location bot for LittleAnnnie
Author:
taygs
Description
Source Code
Launch Bot
Current Users
Created by:
Taygs
/* Title: LittleAnnnie's location filter Author: taygs Credit: badbadbubba - Concept is from 'No Grey Demands,Graphics,Stickykeys,Caps bot' Version: 0.0 (13/05/2016) LittleAnnnie gets very annoyned when people ask where she is from, this aims to filter out those requests. V0.0 - first test version */ var MAX_REASONS = 0; var MAX_CHECKS = 0; var EnterMsg = ''; mutereasons = [ {regexp: /((where are you from)|(what country are you from)|(are you from)|(you're from))/i, notice: 'location', index: 0}, ] cb.settings_choices = [ // {name: 'msgonentry', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Display warning to greys on entry - set to no for busy rooms"}, {name: 'mutehide', type: 'choice', choice1: 'mute', choice2: 'hide', defaultValue: 'mute', label: "Mute (replaces message) or hide (no notifications)"}, {name: 're0', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute location?"}, ]; /* cb.onEnter(function(user) { var i; if (cb.settings['msgonentry'] == 'yes') { if ((!user['has_tokens']) && (!user['is_mod']) && (!user['in_fanclub']) && (user['user'] != cb['room_slug'])) { cb.chatNotice('Welcome ' + user['user'] + '! No Grey Demands Graphics bot is running',user['user'],'',cb.settings['msgcolor'],'bold'); cb.chatNotice(EnterMsg,user['user'],'',cb.settings['msgcolor'],'bold'); cb.chatNotice('Your message will be muted and you risk being silenced for violating these rules',user['user'],'',cb.settings['msgcolor'],'bold'); } } }); 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++) { 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- 2026. All Rights Reserved.