Coder Social home page Coder Social logo

franciscobmacedo / bereal-telegram-bot Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 41 KB

A reminder bot to share a picture with your chat everyday at a random time. Heavily inspired by the app https://bere.al

Dockerfile 6.16% Python 67.74% HTML 26.10%

bereal-telegram-bot's Introduction

Telegram BeReal bot ๐Ÿค–

A reminder bot to share a picture with your chat everyday at a random time. Heavily inspired by the app Bereal.

To use it in your chat

โš ๏ธ This is currently not running live.

For development

To setup locally:

  1. On telegram, contact @BotFather to create a new bot and retrieve both your bot's username and the HTTP API token;
  2. create an .env file, with environment variables, like it's in .env.example - add your bot's TELEGRAM_BOT_USERNAME and TELEGRAM_TOKEN;
  3. Install dependencies with poetry install;
  4. Launch a poetry shell so the dependencies are active: poetry shell;
  5. 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);
  6. Run python run.py bot to start the bot service;

You can also edit src/settings.py with your own preferences where:

  1. DEBUG: variable to set if the command is always sent (if True) or only when the now time corresponds to the defined random time;
  2. SECONDS_BETWEEN_CALLBACK: interval for the bot to check if the current time matches the random defined time - ignored in debug mode;
  3. WELCOME_MESSAGE: message to send to the telegram chat when the bot joins the chat;
  4. CALLBACK_MESSAGE: message to send to the telegram chat every day;
  5. DB_FILE: where to store your chats and the random generated times;
  6. TIMES_TABLE_NAME: the name of the DB table to store the random generated times;
  7. CHATS_TABLE_NAME: the name of the DB table to store the chats ids;

bereal-telegram-bot's People

Contributors

franciscobmacedo avatar

Stargazers

Hemang Joshi avatar

Watchers

 avatar

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.