telebothost/RewardCraftBotPublic · Community Store Listing
Reward Craft
6 commands0 envUpdated 6mo agoCreated Dec 27, 2025
commands/_activate.js
javascript · 43 lines · click line # to share
1/**#command2name: /activate3answer: 4keyboard: 5parse_mode: 6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/* CMD: /setgroup */13 14if (!request.chat || request.chat.type === "private")15 return Api.sendMessage({16 chat_id: user.id,17 text: "⚠️ Please run INSIDE the group.",18 parse_mode: "Markdown",19 reply_to_message_id: request.message_id20 });21 22let chatId = request.chat.id;23 24// only creator can authorize this group25let me = await Api.getChatMember({ chat_id: chatId, user_id: user.id });26let role = me?.result?.status;27if (role !== "creator")28 return Api.sendMessage({29 chat_id: chatId,30 text: "🚫 Only the group *Owner* can activate this bot here.",31 parse_mode: "markdown",32 reply_to_message_id: request.message_id33 });34 35// mark this group as enabled36Bot.set("group_enabled_" + chatId, true);37 38Api.sendMessage({39 chat_id: chatId,40 text: `✅ <b>Bot Activated for this Group</b>\nThis group is now ready to use the point system.`,41 parse_mode: "HTML",42 reply_to_message_id: request.message_id43});