telegram bot issue wrkr not responding, no logs

I have one bot made the same way in JS that responding fine with telegraf api, but I have tried to build new ones with JS or TS , with hono JS or TS, grammY or without bot API . I tried to make very small project with only one bot.command() but it is not working properly as expected...the /start cmd are always pending and coming randomly all at once...so I have maybe 3 answers per cmd. I figure because I have one working that it should something I'm missing towards the functioning of workers. I pretty much do the same , but the working one is using KV.... are they some limits on the free tier ? example, this the grammyY starter that doesn't work... I DON'T GET ANY LOGS and the webhook is set
import { Bot, Context, webhookCallback } from "grammy";

export interface Env {
BOT_INFO: string;
BOT_TOKEN: string;
}
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext,
): Promise<Response> {
const bot = new Bot(env.BOT_TOKEN, { botInfo: JSON.parse(env.BOT_INFO) });
bot.command("start", async (ctx: Context) => {
await ctx.reply("Hello, world!");
});

return webhookCallback(bot, "cloudflare-mod")(request);
},
};
import { Bot, Context, webhookCallback } from "grammy";

export interface Env {
BOT_INFO: string;
BOT_TOKEN: string;
}
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext,
): Promise<Response> {
const bot = new Bot(env.BOT_TOKEN, { botInfo: JSON.parse(env.BOT_INFO) });
bot.command("start", async (ctx: Context) => {
await ctx.reply("Hello, world!");
});

return webhookCallback(bot, "cloudflare-mod")(request);
},
};
THANKS
1 Reply
Voyage Bagage
Voyage BagageOP2mo ago
so to the next finding that, try adding your bot token with the CLI and make sure the there is only one bot token per worker and if still not working try starting a node project and add wrangler on top
Want results from more Discord servers?
Add your server