telebothost/RewardCraftBotPublic · Community Store Listing

Reward Craft

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

commands/_history.js

javascript · 40 lines · click line # to share

1/**#command2name: /history3answer: 4keyboard: 5parse_mode: 6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12 13let uid = user.id;14let key = "history_" + uid;15 16let h = Bot.get(key);17try { h = h ? JSON.parse(h) : []; } catch(e){ h = []; }18 19if (h.length === 0) {20  return Api.sendMessage({21    chat_id: request.chat.id,22    text: "📭 No history yet.",23    reply_to_message_id: request.message_id24  });25}26 27let text = "📜 <b>Your Recent Transfers</b>\n\n";28 29h.forEach((x,i)=>{30  let g = x.group ? ` (${x.group})` : "";31  let sign = x.amount > 0 ? "+" : "";32  text += `${i+1}. ${sign}${x.amount} 💎 — <code>${x.from}${x.to}</code>\n`;33});34 35Api.sendMessage({36  chat_id: request.chat.id,37  text: text,38  parse_mode: "HTML",39  reply_to_message_id: request.message_id40});