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,388Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

We're live here https://discord.com/channels/930051556043276338/1278977038430240813

henri-c · 6d ago

rubenf

Infrastructure as code

rubenf · 4w ago

rubenf

As we're preparing for a new Windmill sandbox SDK, we took the opportunity **to open-source NSJAIL sandboxing** and make it available in CE and easier to set. In 1.634.0, just set nsjail to benefit from the tightest security and isolation per job. It's constraining so no need to use it unless you need but now you won't be restricted in security for CE if you need to.

rubenf · 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
16mo ago
Single script with long running loop vs flow loop feature
benBben / help
2mo ago