Code Monkey home page Code Monkey logo

tg-autoresponder's Introduction

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 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

Contributors

tg-autoresponder's People

Contributors

jon4hz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nrkmrvl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.