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
