Skip to content

Commit 8235d54

Browse files
committed
fix startup
1 parent 96fb1aa commit 8235d54

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tgbot.deno.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const PRINTER_TOKEN = Deno.env.get("PRINTER_TOKEN")!;
1919

2020
export const webhookPath = "/tg-webhook";
2121

22+
const bootId = Math.random().toString(36).slice(2, 10);
23+
2224
export type RequestEvent = {
2325
request: Request;
2426
respondWith(r: Response): Promise<void>;
@@ -383,10 +385,15 @@ export async function init() {
383385
"setWebhook"
384386
);
385387

386-
await tgCall({
387-
photo: `https://${DOMAIN}/startup.jpg`,
388-
chat_id: MAIN_CHAT_ID,
389-
}, "sendPhoto");
388+
setTimeout(async () => {
389+
await tgCall(
390+
{
391+
photo: `https://${DOMAIN}/startup.jpg?q=${bootId}`,
392+
chat_id: MAIN_CHAT_ID,
393+
},
394+
"sendPhoto"
395+
);
396+
}, 2000);
390397

391398
Deno.cron("tuuuuuuuuuu", "0 11 * * 4#1", () => {
392399
tgCall({

0 commit comments

Comments
 (0)