https://github.com/jon4hz/tg-autoresponder
☎️ Telegram Autoresponder
https://github.com/jon4hz/tg-autoresponder
autoresponder telegram telegram-bot telegram-userbot
Last synced: 11 months ago
JSON representation
☎️ Telegram Autoresponder
- Host: GitHub
- URL: https://github.com/jon4hz/tg-autoresponder
- Owner: jon4hz
- License: mit
- Created: 2021-03-02T09:35:44.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-13T09:01:55.000Z (almost 5 years ago)
- Last Synced: 2025-04-23T02:53:13.592Z (about 1 year ago)
- Topics: autoresponder, telegram, telegram-bot, telegram-userbot
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tg-autoresponder
## About
This userbot is an autoresponder that responds with a predefined message if no message has been received for a certain time. The timeout time gets calculated for every user.
The timeout is set for each user individually. The userbot only responds to messages from persons. Messages from groups or bots will be ignored.
## Prerequisites
To use the autoresponder you'll need to create a Telegram Application. Follow this [tutorial](https://core.telegram.org/api/obtaining_api_id) if you are unfamiliar with that.
The following programs are also required:
* `docker`
* `docker-compose`
## Setup
### Build the image
To build the image use `sudo docker-compose build`
### Environment variables
Set all required variables in the file `env_autoresponder`.
| Variable | Function | Default |
| --- | --- | --- |
| TELEGRAM_API_ID | Your Telegram API ID | - |
| TELEGRAM_API_HASH | Your Telegram API HASH | - |
| TELEGRAM_PHONE | Your phone number | - |
| DATABASE_FILE | Location of the database file | data/database.db |
| AUTORESPONDER_TIMEOUT | Timeout in minutes | 60 |
### Inital setup
Since telethon generates a session file the first startup, the container must be started initially with `sudo docker-compose run autoresponder`.
After that it stores the session file and the container can be started in the background by executing `sudo docker-compose up -d`
## Customization
### Autoresponder Message
The message which will be sent is located in `./data/message.py`. After editing the message, restart the container with `sudo docker-compose restart`.
### Exclude users
There is an option to exclude users from receiving the automated message. Add a users Telegram ID in the `excluded_users` array in the file `./data/config.py`.
## Contribute
This is an open source project which welcomes any kind of contributions.
### Contributors
[](https://github.com/jon4hz/tg-autoresponder/graphs/contributors)