Bots Home
|
Create an App
Filter Blocked Words and Emojis
Author:
lady_eboshi_dev
Description
Source Code
Launch Bot
Current Users
Created by:
Lady_Eboshi_Dev
cb.settings_choices = [ { name:'blockWords', type:'str', label:'Block These words (Separated with comma and no space)' }, { name:'blockGifs', type:'choice', label:'Block GIFs/Emojis for gray users?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name:'blockGifMessage', type:'str', required: false, label:'Block GIFs/Emojis Message', defaultValue: 'GIFs and Emojis are not permitted for users without tokens ;)' }, ] cb.onMessage((msg) => { let blockWords = cb.settings.blockWords.split(',') let message = msg.m.split(' ') let isGray = msg.is_mod == false && msg.user != cb.room_slug && msg.tipped_recently == false && msg.tipped_alot_recently == false && msg.tipped_tons_recently == false && msg.has_tokens == false && msg.in_fanclub == false // Block words defined in list for (let i = 0; i < blockWords.length; i++) { if (msg.m.indexOf(blockWords[i]) != -1) { msg['X-Spam'] = true } } // Block emojis and gifs for grays if (isGray) { for (let i = 0; i < message.length; i++) { if (message[i].charAt(0) == ":") { msg['X-Spam'] = true cb.sendNotice(cb.settings.blockGifMessage, msg.user, '#000000', '#FFFFFF', 'bold') } } } return msg; });
© Copyright Chaturbate 2011- 2024. All Rights Reserved.