WindmillWWindmill
Powered by
Bagas WastuB
Windmill•3y ago•
2 replies
Bagas Wastu

Long Running Scripts

Hello, I want to create a telegram bot using grammy.dev as framework. But the script is ended even though I'm using
  bot.start();
  bot.start();
. Is there any way to make the script run longer?

Here is my code:
import { Bot } from "https://deno.land/x/grammy@v1.20.3/mod.ts";
import * as wmill from "https://deno.land/x/windmill@v1.248.0/mod.ts";

export async function main(debug: boolean) {
  const token = debug
    ? (await wmill.getVariable("u/x/telegram_bot_token_dev"))!
    : (await wmill.getVariable("u/x/telegram_bot_token"))!;

  const bot = new Bot(token);

  bot.on("message", (ctx) => ctx.reply("Got another message!"));

  bot.start();
}
import { Bot } from "https://deno.land/x/grammy@v1.20.3/mod.ts";
import * as wmill from "https://deno.land/x/windmill@v1.248.0/mod.ts";

export async function main(debug: boolean) {
  const token = debug
    ? (await wmill.getVariable("u/x/telegram_bot_token_dev"))!
    : (await wmill.getVariable("u/x/telegram_bot_token"))!;

  const bot = new Bot(token);

  bot.on("message", (ctx) => ctx.reply("Got another message!"));

  bot.start();
}
WindmillJoin
3,362Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

Sourcing PowerShell scripts from other PowerShell scripts
DannlyDDannly / help
2y ago
Restoring deleted scripts
anapsixAanapsix / help
2y ago
Having trouble running python scripts that depend on packages from AWS codeartifact.
AlekseyAAleksey / help
15mo ago
Single script with long running loop vs flow loop feature
benBben / help
4w ago