Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 3.36 KB

README.md

File metadata and controls

31 lines (24 loc) · 3.36 KB

nenoy-the-bot

Personal assistant Telegram bot. Currently ships my daily puzzle scores to galiarmero.dev/puzzle-scores 🚀

Development

Environment variables

Variable Description Value
BOT_TOKEN Unique Telegram authentication token assigned when bot was created. e.g. 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
NENOY_API_BASE_URL URL of the backend server. e.g. https://nenoy-api.example.com
ALLOWED_USER_IDS Telegram user IDs that the bots will interact with. e.g. 324501,202910
NOTIF_CHAT_IDS Telegram chat IDs where notifications will be sent. e.g. 90192920,2038494
NENOY_API_USER Username for the backend server.
NENOY_API_PASS Password for the backend server.
NENOY_API_TIMEOUT Optional. Timeout in milliseconds on backend server requests. Default: 5000
NENOY_API_RETRY_MAX Optional. Maximum number of retry attempts after encountering retriable errors. Default: 5
NENOY_API_RETRY_DELAY Optional. Delay in milliseconds before retrying requests after retriable errors. Default: 10000
WEBHOOK_BASE_URL Required when UPDATE_METHOD is not polling.

URL of the webhook server where Telegram bot updates will be sent._
e.g. http://localhost:3000
UPDATE_METHOD How updates from Telegram will be received by the bot. polling or webhook

Default: webhook
NODE_ENV Current deployment environment. Mainly used to decide how webhook server will be set up. development or production
PORT Port where the server will run e.g. 3000

Starting the bot

To start a local webhook server:

npm run dev