You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 1. Install dependencies
npm i
# 2. Set BOT_SERVER_HOST to localhost# Set BOT_SERVER_PORT to any available port# 2. Run bot (in watch mode)
npm run dev
Production mode:
# 1. Install dependencies
npm i --only=prod
# 2. Set NODE_ENV to production# Change BOT_WEBHOOK to the actual URL to receive updates# 3. Run bot
npm start
# or
npm run start:force # if you want to skip type checking
List of available commands
npm run lint — Lint source code.
npm run format — Format source code.
npm run typecheck — Runs type checking.
npm run dev — Starts the bot in development mode.
npm run start — Starts the bot.
npm run start:force — Starts the bot without type checking.
Environment Variables
Variable
Type
Description
NODE_ENV
String
Application environment (development or production)
Webhook endpoint, used to configure webhook in production environment.
WEBAPP_URL
String
HTTPS link to Web App.
API_URL
String
`/api` endpoint (must be public and available to Telegram)
LOG_LEVEL
String
Optional.
Application log level.
See Pino docs for a complete list of available log levels.
Defaults to info.
BOT_SERVER_HOST
String
Optional. Server address.
Defaults to 0.0.0.0.
BOT_SERVER_PORT
Number
Optional. Server port.
Defaults to 80.
BOT_ALLOWED_UPDATES
Array of String
Optional. A JSON-serialized list of the update types you want your bot to receive. See Update for a complete list of available update types.
Defaults to an empty array (all update types except chat_member).
BOT_ADMIN_USER_ID
Number or Array of Number
Optional. Administrator user ID. Commands such as /setcommands will only be available to a user with this ID.
Defaults to an empty array.