Apps Home
|
Create an App
Follower Milestone Celebration B
Author:
seattlescarletjojo
Description
Source Code
Launch App
Current Users
Created by:
Seattlescarletjojo
// Bot settings cb.settings_choices = [ {name: 'milestone_1', type: 'int', minValue: 10, maxValue: 10000, defaultValue: 100, label: 'First Milestone (followers)'}, {name: 'milestone_2', type: 'int', minValue: 10, maxValue: 10000, defaultValue: 500, label: 'Second Milestone (followers)'}, {name: 'milestone_3', type: 'int', minValue: 10, maxValue: 10000, defaultValue: 1000, label: 'Third Milestone (followers)'}, {name: 'celebration_message', type: 'str', minLength: 1, maxLength: 256, defaultValue: '🎉🎉 We hit [milestone] followers! Thank you all for your support! 🎉🎉', label: 'Milestone Celebration Message'} ]; // Variables to track follower count let currentFollowers = 0; let milestones = [cb.settings.milestone_1, cb.settings.milestone_2, cb.settings.milestone_3]; // Function to announce follower milestones function announceMilestone(milestone) { let celebrationMessage = cb.settings.celebration_message.replace("[milestone]", milestone); cb.sendNotice(celebrationMessage, '', '#FFD700', '#000000', 'bold'); // Bright yellow background, black text } // Function to check follower milestones function checkFollowerMilestone() { cb.getRoomOwnerData(function(ownerData) { if (ownerData.success) { currentFollowers = ownerData.data.followers; milestones.forEach(function(milestone) { if (currentFollowers >= milestone) { announceMilestone(milestone); milestones = milestones.filter(function(m) { return m > milestone; }); // Remove reached milestones } }); } }); } // Handle new followers cb.onFollow(function(user) { cb.sendNotice("🎉 Thank you for following, " + user['username'] + "! We appreciate your support! 🎉", user['username'], '#FF69B4', '#FFFFFF', 'bold'); // Pink background, white text checkFollowerMilestone(); // Check if we've hit a new milestone after a new follower }); // Check follower milestones periodically cb.setTimeout(function repeatMilestoneCheck() { checkFollowerMilestone(); cb.setTimeout(repeatMilestoneCheck, 60000); // Check every 60 seconds }, 60000);
© Copyright Freesexcam 2011- 2024. All Rights Reserved.