Bots Home
|
Create an App
lotfcafc bot
Author:
lotfcafc
Description
Source Code
Launch Bot
Current Users
Created by:
Lotfcafc
const muteReasons = [ // From No Grey Demands /\b(show|see)\b.*\b(face)\b/i, // demands /(^|\s):[\w\-]{2,}(\s|$)/i, // graphics /\b(pm|c2c|cam?2?cam|private|pr?vt)\b/i, // PM request /snapchat|swipegirls|freecambook|skype|freetoken|kik|mypage|leaked|mybio|mycam|myprofile|mypr0file|myroom|tokengenerator|streamingnaked|erotimo|amecam|1.?f|bestwork|premiumcheat|ellagocam|visitthis|fucktubate|goo\.gl|goodotgl|\.com|dotcom|aly.sky|www/i, // spam /\b(f.?e.?e.?t|f33t?|foot|soles?|toes?)\b/i, // feet /[^\x00-\x7F\xA3\xA5\u20ac]/, // non-english /^(face|watch my cam|watch me).?.?$/i, // demands // Custom /\b(jungs|dame|frauen)\b/i, // foreign poaching /\b(stop tip|steal|who.*tip|wtf is this)/i, // discouraging tips /\b(stupid idiot|fuck you|cyberattack)\b/i, // rude /\b(copyright)\b/i, // etc ] const tempMuteReasons = [] cb.settings_choices = [ { name: 'maxlength', type: 'int', defaultValue: 500, required: true, label: 'Max length of a message' }, { name: 'minallcaps', type: 'int', defaultValue: 2, required: true, label: 'Minimum number of capital letters to be classified as ALLCAPS' }, ] const allCapsRegex = new RegExp(`\\b[A-Z]{${+cb.settings.minallcaps},}\\b`) for (let i = 1; i <= 10; i++) { cb.settings_choices.push({ name: `block${i}`, type: 'str', required: false, label: `Block Regex ${i}`, }) const b = cb.settings[`block${i}`] if (b) { muteReasons.push(new RegExp(b, 'i')) } } cb.onMessage(msg => { // Scan unblocked messages that aren't from broadcaster/mod/fans/tippers if (!msg['X-Spam'] && !msg['has_tokens'] && !msg['is_mod'] && !msg['in_fanclub'] && msg['user'] !== cb.room_slug) { let reason = null if (msg['m'].length > cb.settings.maxlength) { reason = `Length ${cb.settings.maxlength}+` } if (allCapsRegex.test(msg['m']) || allCapsRegex.test(msg['m'].replace(/\s+/g, ''))) { reason = `All Caps ${cb.settings.minallcaps}+` } const mr = muteReasons.map(r => r.exec(msg['m']) || r.exec(msg['m'].replace(/\s+/g, ''))).filter(v => !!v) if (mr.length) { reason = mr[0][0] } const tmr = tempMuteReasons.map(r => r.exec(msg['m']) || r.exec(msg['m'].replace(/\s+/g, ''))).filter(v => !!v) if (tmr) { reason = `TEMP: ${tmr[0][0]}` } if (reason) { msg['X-Spam'] = true modMessage(`Blocked ${msg['user']}'s message (${reason}): ${msg['m']}`) } } // Listen for commands from mods if (msg['m'].startsWith('/') && (msg['is_mod'] || msg['user'] === cb.room_slug)) { msg['X-Spam'] = true if (msg['m'].startsWith('/block ')) { const newBlock = new RegExp(msg['m'].substring(7), 'i') tempMuteReasons.push(newBlock) modMessage(`${msg['user']} added block ${newBlock.toString()}`) } if (msg['m'].startsWith('/unblock ')) { const m = msg['m'].substring(9).trim() let idx = -1 if (/^[0-9]+$/.test(m)) { idx = +m-1 } else { idx = tempMuteReasons.findIndex(mr => mr.toString().toLowerCase() === `/${m}/i`.toLowerCase()) } if (idx >= 0) { const tmr = tempMuteReasons.splice(idx, 1) modMessage(`${msg['user']} removed block ${tmr.toString()}`) } } if (msg['m'].startsWith('/clearblocks')) { modMessage(`${msg['user']} cleared all (${tempMuteReasons.length}) temporary blocks`) tempMuteReasons.length = 0 } if (msg['m'].startsWith('/listblocks')) { if (tempMuteReasons.length) { cb.sendNotice(tempMuteReasons.map((r, idx) => `Block ${idx + 1}: ${r.toString()}`).join('\n'), msg['user']) } else { cb.sendNotice('No temporary blocks in place', msg['user']) } } } return msg }) function modMessage(m) { cb.sendNotice(m, null, null, '#8B0000', null, 'red') if (cb.room_slug === 'lotfcafc') { cb.sendNotice(m, 'lotfcafc', null, '#8B0000', null) } }
© Copyright Chaturbate 2011- 2025. All Rights Reserved.