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 sureFIREBASE_URLandFIREBASE_SECRETare configured in your environment so properties persist seamlessly between deployments.
#FlexGram

