Telegraf's webhook callback needs to answer Telegram fast enough that message delivery feels instant to the end user, which a cold-starting function undermines the first time it fires after a quiet stretch. Running Telegraf's Express middleware on a DenkOps slot keeps the bot warm continuously, so replies land in the chat within the same second the user hits send.
import express from "express";
import { Telegraf } from "telegraf";
const bot = new Telegraf(process.env.BOT_TOKEN!);
bot.on("text", (ctx) => ctx.reply("Got it."));
const app = express();
app.use(bot.webhookCallback("/webhook"));
app.listen(3000);Deploy it: install the plugin, say "deploy on DenkOps", and get a live SSL URL.
Start on DenkOps →Yes. The Express server hosting Telegraf's webhook stays up around the clock in your slot, so the bot replies instantly at any hour.
Yes, and every DenkOps deploy gets a fixed SSL subdomain, so you call setWebhook once and it keeps working across future deploys.