telebothost/DailySparkCWMBotPublic · Community Store Listing
Daily Spark Bot
6 commands0 envUpdated 6mo agoCreated Dec 27, 2025
commands/🎯 Get Today’s Challenge.js
javascript · 151 lines · click line # to share
1/**#command2name: 🎯 Get Today’s Challenge3answer: 4keyboard: 5parse_mode: 6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// Challenges to be given13const challenges = [14 "Study for 25 minutes without checking your phone",15 "Write down 3 things you’re grateful for today",16 "Drink 2 full glasses of water right now",17 "Send a kind or encouraging message to someone",18 "Write 5 lines of a short story or poem",19 20 "Revise one topic you studied yesterday",21 "Take 5 deep breaths and relax your shoulders",22 "Stretch your body for 5 minutes",23 "Smile and greet at least one person today",24 "Doodle or sketch anything for 10 minutes",25 26 "Solve 5 practice questions from any subject",27 "Replace one negative thought with a positive one",28 "Take a 10-minute walk",29 "Thank someone who helped you recently",30 "Create a creative caption for a random photo",31 32 "Organize your study notes for 10 minutes",33 "Stay away from complaining for the next hour",34 "Avoid junk food for one meal today",35 "Listen carefully without interrupting someone",36 "Try writing with your non-dominant hand",37 38 "Read 5 pages of a book or notes",39 "Write one thing you did well today",40 "Go to bed 20 minutes earlier than usual",41 "Help someone with a small task",42 "Turn a normal object into a creative idea",43 44 "Make a small to-do list and complete one task",45 "Spend 5 minutes in silence without distractions",46 "Do 15 jumping jacks or light exercise",47 "Compliment someone genuinely",48 "Create a simple logo idea in your mind",49 50 "Watch a short educational video and note one point",51 "Forgive yourself for a recent mistake",52 "Maintain good posture for the next 10 minutes",53 "Ask someone how their day is going",54 "Write a creative username or nickname",55 56 "Summarize one topic in your own words",57 "Avoid negative self-talk for the next hour",58 "Wash your face and feel refreshed",59 "Share a helpful tip with someone",60 "Think of a new app or bot idea",61 62 "Clean your study space for 10 minutes",63 "Say no to procrastination for one small task",64 "Limit screen time for the next 30 minutes",65 "Encourage someone who looks stressed",66 "Write a one-line motivational quote",67 68 "Plan tomorrow’s study in 5 minutes",69 "Focus on what you can control today",70 "Drink water before every meal today",71 "Be patient in a difficult moment",72 "Create a short story using only 5 sentences"73];74 75// Get all the properties like user's challenge, is it completed & last challenge made timestamp to process76const myChallenge = User.get("myChallenge");77const isChallengeCompleted = User.get("isChallengeCompleted");78const lastChallengeMade = User.get("lastChallengeMade");79const now = Date.now();80 81// If user have last challenge made timestamp then it will run82if (lastChallengeMade) {83 const diffInMs = now - lastChallengeMade;84 const diffInHrs = Math.floor(diffInMs / (1000 * 60 * 60));85 86 // Check if the time is completed or not, if not completed or completed then proceed to check if the challenge is completed or not and then proceed87 if (diffInHrs < 24) {88 if (!isChallengeCompleted) {89 msg.reply(`<i>😢 You haven't completed your today's challenge.\n\n⏰ Time Remaining to complete: ${24 - diffInHrs} Hours only</i>\n\n<b>🔥 Today's Challenge:</b> <i>${myChallenge}</i>\n\n<b>💪 Complete it now & be strong.</b>`, {90 parse_mode: "HTML",91 reply_markup: {92 inline_keyboard: [93 [{94 text: "✅ Completed",95 callback_data: "challengeCompleted"96 }, {97 text: "💔 Skip",98 callback_data: "skipChallenge"99 }]100 ]101 }102 });103 } else {104 msg.reply(`<b>💪 You've completed today's challenge. Keep it up.</b>\n\n<i>🔥 New challenge will be given to you after ${24 - diffInHrs} Hours.</i>`, {105 parse_mode: "HTML"106 });107 }108 } else if (diffInHrs >= 24) {109 if (!isChallengeCompleted) {110 msg.reply("<i>😭 Too sad to see this, but you didn't completed your last task. I'm giving you another chance with today's new task. Complete it today and don't be lazy.</i>", {111 parse_mode: "HTML"112 });113 114 let missed = User.get("missed") ? User.get("missed") : 0;115 missed++;116 117 User.set("missed", missed);118 User.set("streak", 0);119 120 assignTask();121 } else {122 msg.reply("<i>💪 Yoy nailed it! Congratulations, you've completed your last task. Here's your new task for today.</i>", {123 parse_mode: "HTML"124 });125 126 assignTask();127 }128 }129} else {130 assignTask();131}132 133// Function to send task, made because it was repeating everytime134function assignTask() {135 User.set("lastChallengeMade", Date.now());136 User.set("isChallengeCompleted", false);137 138 const random = Libs.random.randomInt(0, challenges.length);139 const challenge = challenges[random];140 141 User.set("myChallenge", challenge);142 143 msg.reply(`<b>🔥 Today's Task:</b> <i>${challenge}</i>`, {144 parse_mode: "HTML",145 reply_markup: {146 inline_keyboard: [147 [{ text: "✅ Completed", callback_data: "challengeCompleted" }, { text: "💔 Skip", callback_data: "skipChallenge" }]148 ]149 }150 });151}