Bots Home
|
Create an App
FoxyFlowers
Author:
test2022
Description
Source Code
Launch Bot
Current Users
Created by:
Test2022
/* global cb */ cb.settings_choices = [ { name: "flowerUsers", label: "Flower Users", type: "str", defaultValue: "", required: false, minLength: 1, maxLength: 200000 }, ]; let flowerUsers = [[], [], [], [], []]; if (cb.settings.flowerUsers && cb.settings.flowerUsers.length > 0) { let inUsers = JSON.parse(cb.settings.flowerUsers); if (!inUsers || !inUsers.length === 5) { cb.chatNotice('Invalid input string for Flower Users', cb.room_slug, '#cc0000', '#ffffff', 'bold'); } else { flowerUsers = inUsers; } } const flowerEmotes = [ String.fromCodePoint(127799), String.fromCodePoint(127804), String.fromCodePoint(127803), String.fromCodePoint(127802), String.fromCodePoint(127800) ]; cb.onMessage(msg => { let { m, user } = msg; let out = ''; if (user === cb.room_slug) { if (m === '/flowers') { msg['X-Spam'] = true; cb.chatNotice(JSON.stringify(flowerUsers), user); } } if (flowerUsers[4].includes(user)) { out += flowerEmotes[4] + ' '; } else if (flowerUsers[3].includes(user)) { out += flowerEmotes[3] + ' '; } else if (flowerUsers[2].includes(user)) { out += flowerEmotes[2] + ' '; } else if (flowerUsers[1].includes(user)) { out += flowerEmotes[1] + ' '; } else if (flowerUsers[0].includes(user)) { out += flowerEmotes[0] + ' '; } out += m; msg['m'] = out; return msg; }); cb.onTip(tip => { let { from_user, amount } = tip; if (amount === 11111) { flowerUsers[4].push(from_user); } else if (amount === 5555) { flowerUsers[3].push(from_user); } else if (amount === 1111) { flowerUsers[2].push(from_user); } else if (amount === 555) { flowerUsers[1].push(from_user); } else if (amount === 111) { flowerUsers[0].push(from_user); } })
© Copyright Chaturbate 2011- 2024. All Rights Reserved.