Bots Home
|
Create an App
Aria's FanClub
Author:
jackblackanory
Description
Source Code
Launch Bot
Current Users
Created by:
Jackblackanory
///////////////////////////////////////////////////// //// //// Created and modified by wearehomoerectus //// //////////////////////////////////////////////////// //this sets up all the configurable choices in the settings of the App cb.settings_choices = [ {name: 'clubName', label: 'Name of the FanClub: ', type: 'str', minLength: 0, maxLength: 50, required: false, defaultValue: 'Aria\'s midget squad'}, {name: 'nameDecoration', label: 'Any gifs or prefix before the username add them here: ', type: 'str', minLength: 0, maxLength: 50, required: false, defaultValue: '[:ClubCantHandle][Aria\'s Midget Squad]'}, {name: 'joinTip', label: 'Tip amount required to join the Fanclub: ', type: 'int', minValue: 1, defaultValue: 899}, {name: 'announce1', label: 'Announcement when a user joins the FanClub, you can change anything AFTER the word USERNAME: ', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'USERNAME just joined Aria\'s midget squad FanClub :aria-love'}, {name: 'memberList1', label: 'List of Current FanClub members MUST BE SEPARATED BY COMMA , (Paste the usernames of people who tipped previously into here before starting the Bot): ', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'wearehomoerectus'}, {name: 'textColor1', label: 'text colour of FanClub Members – its in HTML colour code so google it if you\'re not sure which colour you want and add it without the \'# \': ', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'bGColor1', label: 'Background colour of text written by FanClub members', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '287aff'}, //{name: 'moderators', label: 'List of moderators (this will send them a message when you leave to keep track of the usernames of FanClub members): ', type: 'str', minLength: 0, maxLength: 2000, required: false, defaultValue: ''}, ]; //setting up array variables to hold all the different club members var memberSettings = [], clubMembers1 = [], timeOnEnter = {}; let date = new Date(); //this code is run when the user who has joined the room sends a message cb.onMessage(function(msg){ var u = msg.user; //gets the username of whoever typed the message and places it in u variable //if the user types /names into the chat, then hide that message from other users, and display the usernames to the one requesting if(msg.m.indexOf('currentfanclubmembers') >= 0){ msg['X-Spam'] = true; msg.background = '#E6E6FA'; msg.c = '#000000'; sendNames(u) } if(msg.m.indexOf('save') >= 0){ msg['X-Spam'] = true; msg.background = '#E6E6FA'; msg.c = '#000000'; cb.chatNotice("hello, trying to save"); cb. chatNotice("Current date is: " + date.getDay() ); } //if the user is part of a club, then decorate his message with pre-determined gif etc. else if(isClubMember1(u)){ msg.m = cb.settings.nameDecoration+' '+msg.m msg.c = '#'+cb.settings.textColor1; msg.background = '#'+cb.settings.bGColor1; return msg; } else{ return msg; //must return msg object at the end of the function always } }); //if a user tips the amount required to join a club, then display a notification and announcement and if that person is not already a member then add them to the end of the club array cb.onTip(function(tip){ var amountTipped = parseInt(tip.amount), u = tip.from_user; if(amountTipped == cb.settings.joinTip){ var announcement = cb.settings.announce1.replace("USERNAME", u); if(!isClubMember1(u)){clubMembers1.push(u)} cb.chatNotice(announcement, '', '#'+cb.settings.bGColor1, '#'+cb.settings.textColor1, 'bold'); } }); //if on enter a club member joins the room, then display an announcement cb.onEnter(function(user){ var u = user.user, b = cb.room_slug; cb.chatNotice('Welcome to the room, Tip ' + cb.settings.joinTip + ' to join ' + cb.settings.clubName + '!'); if(isClubMember1(u)){ cb.chatNotice(b+'\'s '+cb.settings.clubName+' member '+u+' just entered the room!','','#'+cb.settings.bGColor1,'#'+cb.settings.textColor1) timeOnEnter.u = new Date().getTime() } }); //if a club member has left the room then display an announcement that they have left the room //if broadcaster has left the room then send usernames to the mods in that room so they can keep track of it cb.onLeave(function(user){ var u = user.user, b = cb.room_slug, time = new Date().getTime(); if(isClubMember1(u) && time-timeOnEnter.u>60000){cb.chatNotice(b+'\'s '+cb.settings.clubName+' member '+u+' just left the room!','','#'+cb.settings.bGColor1,'#'+cb.settings.textColor1)} else if(u == b && time-timeOnEnter.u>60000){sendNames(wearehomoerectus)} //this sends the names of the current fan club members to a moderator or someone who is keeping track of the usernames so they can be stored for later use }); function isClubMember1(username){return(clubMembers1.includes(username))} function sendNames(username){ //displays club members 1, plus adds a newline at the end of the clubnames and displays the next club members cb.chatNotice(cb.settings.clubName+' Members: '+clubMembers1.toString().replace(/,/g,', ')+'\n', username); } //splits usernames with a comma and gets rid of the spaces between them, if there are any occurences of that if(cb.settings.memberList1){ memberSettings = cb.settings.memberList1.split(','); for(i=0; i<memberSettings.length; i++){clubMembers1[i] = memberSettings[i].toLowerCase().replace(/ /g,"");} }
© Copyright Chaturbate 2011- 2025. All Rights Reserved.