telebothost/DailySparkCWMBotPublic · Community Store Listing

Daily Spark Bot

ProfileTelegram
6 commands0 envUpdated 6mo agoCreated Dec 27, 2025
Back to folder

commands/challengeCompleted.js

javascript · 34 lines · click line # to share

1/**#command2name: challengeCompleted3answer: 4keyboard: 5parse_mode: 6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// First check if this command must be run by inline keyboard 13if (request && request.message.message_id) {14  // Then delete the message & complete the task15  Api.deleteMessage({16    chat_id: request.from.id,17    message_id: request.message.message_id18  });19 20  let completed = User.get("completed") ? User.get("completed") : 0;21  let streak = User.get("streak") ? User.get("streak") : 0;22  23  completed++;24  streak++;25 26  // Update all the values27  User.set("isChallengeCompleted", true);28  User.set("completed", completed);29  User.set("streak", streak);30 31  Bot.sendMessage("<i>💪 Yeah Buddy! You completed your today's challenge before the deadline. See you again tomorrow. Be strong.</i>", {32    parse_mode: "HTML"33  });34}