# Telegram bot

A Telegram bot that replies to messages, always on. It asks Telegram for new messages itself, so it needs no public URL.

## Get it

```sh
$ npx dukoi init telegram-bot
```

It makes a `telegram-bot` folder and deploys it. On the phone instead: **Try a template → Telegram bot → Deploy**.

## You need a token

1.  In Telegram, message **@BotFather** and send `/newbot`.
2.  Pick a name. BotFather gives you a token like `123456:ABC-def…`.

`init` asks for it and saves it on the phone as a setting, never in the folder. To change it later:

```sh
$ npx dukoi env set TELEGRAM_BOT_TOKEN=123456:ABC...
```

## What you get

Message your bot. It answers `/start` and repeats anything else you send.

## Make it yours

Four files. You only need to touch one.

- `bot.js`: The replies. Edit this one.
- `dukoi.json`: Tells Dukoi it opens no port
- `package.json`: Its name. No packages needed.
- `README.md`: How to run it, in five minutes

Change the `/start` reply in `bot.js`:

```
if (text === '/start') {
  return 'Welcome to my bot 👋'
}
```

Then deploy again. The bot keeps its token.

```sh
$ npx dukoi deploy
```

> No health check
> 
> A bot opens no port, so `dukoi.json` turns the check off. Dukoi counts it as healthy if it’s still running after 3 seconds.
