Giter VIP home page Giter VIP logo

suttabot's Introduction

suttabot

This project is a Telegram bot written in Rust, using the teloxide library. The bot allows users to subscribe or unsubscribe from daily suttas (ancient buddhist scriptures) in Russian translation of the Theravada branch of buddhism. The messages are sent from a collection of files in a specified directory, with one file randomly chosen each day. The bot uses SQLite for storing subscription data.

Note that this project currently support only Russian language.

The data is not stored in the repo to avoid conflict with authors. All suttas are taken from site theravada.ru, which is one of the biggest sites with Russian translations of Theravada teachings and suttas.

Inspired by Reading Faithfully.

Environment Variables

Variable Description Required Default
TELOXIDE_TOKEN The telegram bot token. Yes None
DATABASE_URL The URL of the SQLite database. Yes None
DATA_DIR The directory where the message files are stored. Yes None
MESSAGE_INTERVAL The interval in seconds between each daily message. No 86400 (24 hours)

Running Locally

Without Docker

  1. Set the required environment variables
  2. Run the project: cargo run

With Docker

  1. Install Docker: https://docs.docker.com/get-docker/
  2. Build the Docker image: docker build -t suttabot .
  3. Run the Docker container, passing in the environment variables:
docker run -d --name=suttabot -e RUST_LOG=info -e TELOXIDE_TOKEN="<TELOXIDE_TOKEN>" -e DATABASE_URL="sqlite:///db/suttabot.db" -e DATA_DIR="/data" -v "<LOCAL_DB_PATH>:/db/suttabot.db" -v "<LOCAL_DATA_PATH>:/data" suttabot

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

All suttas and texts are taken from theravada.ru website and SuttaCentral repository.

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.