Giter VIP home page Giter VIP logo

sktg's Introduction

This README is outdated, sorry

What is this?

This is the source code of my Telegram bot.

Running

You'll need:

  1. Git, lol
  2. Python (3.10 or later) or Docker (preferably with docker-compose)
  3. A Telegram Bot API token

Preparations:

  1. Clone the repo, obviously.
  2. Save your token into the token.txt file in the root of the repo.
  3. You might want to make yourself an admin of the bot. To do that, put your Telegram id to the admins.txt file in the root of the repo.

Running:

Docker:

  1. For the ease of development, you can copy the docker-compose.debug.yml file to docker-compose.override.yml: it increases the verbosity of logging and disables auto-restarts of the service.
  2. Just run
docker-compose up

No Docker:

  1. Set up a venv:
python3.10 -m venv venv
source venv/bin/activate
  1. Install the dependencies:
pip install -r requirements.txt
  1. Run the code:
python3 -m junior

P.S.

  • You can change logging verbosity by passing a LOGLEVEL env variable. Like this if you're on Linux:
LOGLEVEL=DEBUG python3 -m junior
  • You can change the path to the sqlite database file by passing a DATABASE_FILE env variable.
  • You can change the path to the file with bot admin ids by passing a BOT_ADMINS_FILE env variable.
  • You can change the path to the file with your token by passing a BOT_TOKEN_FILE env variable.
  • Or you can just directly pass the token via a BOT_TOKEN env variable.
  • And you can change the path to bot's tmp directory by passing a TMP_DIR env variable.

Contributing

Just open a pull request or an issue! I'll be grateful.

Other stuff to look at

  • rust branch: an abandoned attempt to rewrite the same bot in Rust.
  • python-old branch: my old Telegram bots, written in Python a long time ago (not too proud of that code).
  • java branch: an abandoned attempt to rewrite my old bots into Java.

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.