A reminder bot to share a picture with your chat everyday at a random time. Heavily inspired by the app Bereal.
To setup locally:
- On telegram, contact
@BotFather
to create a new bot and retrieve both your bot's username and the HTTP API token; - create an
.env
file, with environment variables, like it's in.env.example
- add your bot'sTELEGRAM_BOT_USERNAME
andTELEGRAM_TOKEN
; - Install dependencies with
poetry install
; - Launch a poetry shell so the dependencies are active:
poetry shell
; - Run
python run.py set-times <NUMBER_OF_DAYS> <MIN_HOUR> <MAX_HOUR>
to fill the times table with random times where:NUMBER_OF_DAYS
- optional - is the number of days that the bot will run for, starting today (default: 300);MIN_HOUR
- optional - is the earliest hour to send the message (default: 9);MAX_HOUR
- optional - is the latest hour to send the message (default: 22);
- Run
python run.py bot
to start the bot service;
You can also edit src/settings.py
with your own preferences where:
DEBUG
: variable to set if the command is always sent (ifTrue
) or only when the now time corresponds to the defined random time;SECONDS_BETWEEN_CALLBACK
: interval for the bot to check if the current time matches the random defined time - ignored in debug mode;WELCOME_MESSAGE
: message to send to the telegram chat when the bot joins the chat;CALLBACK_MESSAGE
: message to send to the telegram chat every day;DB_FILE
: where to store your chats and the random generated times;TIMES_TABLE_NAME
: the name of the DB table to store the random generated times;CHATS_TABLE_NAME
: the name of the DB table to store the chats ids;