Skip to content

Source code of CounterBot, a Telegram bot

License

Notifications You must be signed in to change notification settings

Pablo-Davila/TrainCounterBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrainCounterBot

Have you ever wanted to set a daily/weekly training objective? Maybe just a simple +1/-1 counter? This bot makes it easier by keeping track of your collection of counters and increasing them with the frequency you want.

It is based on pyTelegramBotAPI, a Python interface for the Telegram Bot API.

Try it in Telegram: TrainCounterBot

Usage

To run your own instance of this bot you must first register a new Telegram bot. Once you have a token for your bot, you may proceed with options 1 or 2.

Option 1: Manual execution

First, you have to create the necessary environment variables:

  • BOT_TOKEN: The token you obtained in the previous step.
  • DATA_DIR_PATH: The path for the data directory.

After that, you only need to execute the following terminal command:

python ./src/train_counter_bot.py

This will run the bot attached to your current terminal. If you want it to stay in the background you should have a look at tools like tmux.

Option 2: Docker container (recommended)

First, you have to create a ".env" file in the repository root with the following format:

DATA_DIR_PATH=pat_to_the_data_directory
BOT_TOKEN=your_bot_token_here

Now, you can run the bot with a single docker command:

docker compose up -d --build

This will run the bot as a Docker container in the background.

About

Source code of CounterBot, a Telegram bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published