Whenever a client messages asking why their freshly edited CMS article isn't live yet, logging into cloud hosting dashboards from a phone browser is painfully slow. Wiring static site build webhooks directly into FlexGram lets you fire off builds and query status checks in one tap without leaving Telegram. The zero-import
HTTP global handles webhook dispatching effortlessly.📁 Filename:
command/deploy.js👨💻 Code:
sendMessage("🚀 *Select build target:*", {
buttons: [
[{ text: "📦 Staging Rebuild", command: "/run_deploy staging" }],
[{ text: "⚡ Production Rebuild", command: "/run_deploy production" }]
]
});📁 Filename:
command/run_deploy.js👨💻 Code:
sendChatAction("typing");
const target = params || "staging";
const hookUrl = target === "production"
? "https://api.buildhost.com/v1/hooks/prod"
: "https://api.buildhost.com/v1/hooks/stage";
const res = HTTP.post({
url: hookUrl,
body: { trigger: "telegram", user: user.username || user.first_name }
});
USER.setProp("last_target", target);
sendMessage(`🔨 *${target.toUpperCase()}* build triggered.\nQueue ID: \`${res?.data?.id || "active"}\``, {
buttons: [{ text: "🔍 Check Live Status", command: "/build_status" }]
});📁 Filename:
command/build_status.js👨💻 Code:
sendChatAction("typing");
const target = await USER.getProp("last_target").value() || "staging";
const res = HTTP.get({ url: `https://api.buildhost.com/v1/status/${target}` });
const status = res?.data?.status || "deployed";
sendMessage(`📊 *Environment:* \`${target}\`\nStatus: *${status.toUpperCase()}*`, {
buttons: [
[{ text: "🔄 Refresh", command: "/build_status" }],
[{ text: "🚀 Deploy Menu", command: "/deploy" }]
]
});💡 Always trigger
sendChatAction("typing") right before running third-party HTTP calls so the user gets instant visual feedback while external webhooks process.⚠️ Note: Replace the mock buildhost API endpoints with your actual hosting provider's build hook and status URLs.
#FlexGram
