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

๐Ÿ“Ÿ Zero-friction on-call shift handovers right from Telegram

Our site reliability rotations used to break down because engineers hated opening project boards just to log an active shift swap. With persistent reply keyboards and direct Firebase event writes, we turned the entire handover ritual into two instant taps from a phone. The bot pins critical ops triggers directly onto the user's input dock and clears the keyboard the moment they clock out.

๐Ÿ“ Filename: command/shift.js
๐Ÿ‘จโ€๐Ÿ’ป Code:
const actions = [
[{ text: "/incident" }, { text: "/swap" }],
[{ text: "/clockout" }]
];
sendReplyKeyboard("๐Ÿ›  *On-call dock initialized.*\nUse the quick controls below to log activities or rotate coverage.", actions, "Markdown");


๐Ÿ“ Filename: command/swap.js
๐Ÿ‘จโ€๐Ÿ’ป Code:
pushDB("ops_shifts", {
engineer: user.first_name || user.username,
uid: user.id,
action: "ROTATION_COMPLETED",
time: Date.now()
});
sendMessage("๐Ÿ“‹ *Shift swap logged to database.* Standby team alerted.", { parse_mode: "Markdown" });


๐Ÿ“ Filename: command/clockout.js
๐Ÿ‘จโ€๐Ÿ’ป Code:
pushDB("ops_shifts", {
engineer: user.first_name || user.username,
uid: user.id,
action: "SIGNED_OFF",
time: Date.now()
});
removeKeyboard("๐Ÿ‘‹ *Shift ended.* Custom dock buttons dismissed.");


๐Ÿ’ก Always pass a clear exit prompt to removeKeyboard so your team knows their native Telegram input bar has returned to normal.

#FlexGram
๐ŸŽ‰1
August 17, 2026 116