Coder Social home page Coder Social logo

jheniae / telegram-bot-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donbarbos/telegram-bot-template

0.0 0.0 0.0 513 KB

๐Ÿค– Template for telegram bot using postgres, redis, docker, python asyncio

License: GNU General Public License v3.0

Python 90.21% Dockerfile 9.79%

telegram-bot-template's Introduction

Telegram bot.

Checking Status Docker Build Status Python License Code style

๐Ÿš€ Getting Started

Running on Local Machine

  • install dependencies using Poetry

    poetry install
    
  • configure environment variables in .env file

  • start bot in virtual environment

    poetry run python -m bot
    

Launch in Docker

  • configure environment variables in .env file

  • start virtual environment

    poetry shell
    
  • building the docker image

    docker-compose build
    
  • start service

    docker-compose up -d
    

๐ŸŒ Environment variables

variables description
BOT_TOKEN Telegram bot API token
PG_HOST hostname or an IP address PostgreSQL database
PG_NAME the name of the PostgreSQL database
PG_PASSWORD password used to authenticate
PG_PORT connection port number (defaults to 5432 if not provided)
PG_USER the username used to authenticate
REDIS_HOST hostname or an IP address Redis database
REDIS_PASSWORD Redis database password, empty by default
REDIS_PORT port from Redis database

I use Redis for Finite State Machine, and PostgreSQL as Database

๐Ÿ”ง Tech Stack

  • aiogram โ€” asynchronous framework for Telegram Bot API
  • asyncpg โ€” asynchronous PostgreSQL database client library
  • poetry โ€” development workflow
  • loguru โ€” third party library for logging in Python
  • docker โ€” to automate deployment
  • postgres โ€” powerful, open source object-relational database system
  • redis โ€” an in-memory data structure store

๐Ÿ‘ท๐Ÿพ Contributing

First off, thanks for taking the time to contribute! Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork this repository
  2. Create a branch
  3. Commit your changes
  4. Push your commits to the branch
  5. Submit a pull request

๐Ÿ“ License

Distributed under the GPL-3.0 license. See LICENSE for more information.

๐Ÿ“ข Contact

donbarbos: [email protected]

telegram-bot-template's People

Contributors

dependabot[bot] avatar donbarbos 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.