This bot sends a random message from a PostgreSQL database to a specified Telegram chat at regular intervals. The message is chosen randomly from a table of messages in the database.
- Clone the repository
- Install the dependencies with
npm install - Copy the example environment file with
cp .env.example .env - Edit the
.envfile and fill in your Telegram Bot token and PostgreSQL database details - Run the bot with
npm start
To start using the bot, add it to a Telegram group chat and type /start. The bot will then start sending messages to the specified chat at the specified interval.
The following environment variables are used to configure the bot:
TOKEN- Your Telegram Bot tokenDB_HOST- The hostname of your PostgreSQL database serverDB_PORT- The port number of your PostgreSQL database serverDB_USER- The username for your PostgreSQL databaseDB_PASSWORD- The password for your PostgreSQL databaseDB_NAME- The name of your PostgreSQL databasePARTNER_CHAT_ID- The chat ID of the chat to send messages to
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE.md file for details.