Flex Coder: post #1581 โ€” TG.ME

๐Ÿ† Team Sprint Kudos Pool & Reward Ledger in Telegram

Keeping engineering morale high during crunch weeks doesn't require a bloated third-party SaaS subscription. We set up an internal micro-kudos bank in Telegram where developers claim a daily allowance and tip tokens into a shared sprint pool. Persistent USER and BOT properties handle isolated balances and global tally tracking automatically with zero database boilerplate.

๐Ÿ“ Filename: daily.js
๐Ÿ‘จโ€๐Ÿ’ป Code:
const claimed = await USER.getProp('daily_claimed').value();
const today = new Date().toISOString().slice(0, 10);
if (claimed === today) {
sendMessage('โณ You already claimed your 50 daily kudos for today!');
return;
}
USER.setProp('daily_claimed', today);
const balance = (await USER.getProp('balance').value()) || 0;
USER.setProp('balance', balance + 50);
sendMessage('๐ŸŽ Credited *50 kudos* to your account! Check the ledger via `/pot` or tip the pool with `/tip 10`.');


๐Ÿ“ Filename: tip.js
๐Ÿ‘จโ€๐Ÿ’ป Code:
const amount = Math.max(1, parseInt(params, 10) || 10);
const balance = (await USER.getProp('balance').value()) || 0;
if (balance < amount) {
sendMessage(`โš ๏ธ Insufficient balance! You have *${balance}* kudos available.`);
return;
}
USER.setProp('balance', balance - amount);
const pool = (await BOT.getProp('sprint_pool').value()) || 0;
BOT.setProp('sprint_pool', pool + amount);
const totalTipped = (await USER.getProp('total_tipped').value()) || 0;
USER.setProp('total_tipped', totalTipped + amount);
sendMessage(`โœจ You pitched *${amount}* kudos into the sprint pot! Current balance: *${balance - amount}*.`);


๐Ÿ“ Filename: pot.js
๐Ÿ‘จโ€๐Ÿ’ป Code:
const pool = (await BOT.getProp('sprint_pool').value()) || 0;
const tipped = (await USER.getProp('total_tipped').value()) || 0;
const balance = (await USER.getProp('balance').value()) || 0;
sendMessage(`๐Ÿ† *Sprint Kudos Ledger*\n\n๐Ÿ”ฅ Total Team Pot: *${pool}* kudos\n๐Ÿ‘ค Your Contributions: *${tipped}* kudos\n๐Ÿ’ฐ Available Balance: *${balance}* kudos`, {
buttons: [
[
{ text: "๐ŸŽ Claim Daily Kudos", command: "/daily" },
{ text: "โšก Tip 10 Kudos", command: "/tip 10" }
]
]
});


๐Ÿ’ก BOT.setProp syncs across all members instantly while USER.setProp guarantees each developer's balance stays strictly scoped to their Telegram ID.

โš ๏ธ Note: Make sure FIREBASE_URL and FIREBASE_SECRET are configured in your environment so properties persist seamlessly between deployments.


#FlexGram
๐Ÿ‘1๐Ÿ˜1
August 22, 2026 73