Coder Social home page Coder Social logo

bot_async_factory's Introduction

Bot Async Factory:

Example bot factory include discord, telegram and an app logic where showing how utilize async abstract transport based on abc_handler module. link on module: https://github.com/vzip/async_abc_transport

Project Structure: - app/ - discord/ - telegram/ - docker-compose.yml

How to run

  1. Install docker engine and compose
  2. Create .env from exapmle_env and put your keys
  3. Run commands
    • docker compose build --no-cache
    • docker compose up or docker compose up -d

Architecture All app's import abc_handler module directory.

app/

  • Dockerfile: Docker configuration for the app service.
  • abc_handler/: Module directory of original abc_handler for handling messages and connections.
    • config_queue.py: Defined sources names of queues ['discord', 'telegram'] to listen in the AbstractConnectorAsync class.
  • bot_logic.py: The main logic for bot operation.
    • get_message from all queues
    • get source from message
    • do logic for that source type,
    • change source name in message object to source_send
    • push_message send finally message to queue, on other side reciever will pickup message and delivery by messanger bot client

discord/

  • Dockerfile: Docker configuration for the Discord bot service.
  • abc_handler: Module directory of original abc_handler for handling messages and connections.
    • config_queue.py: Defined sources names for queues ['discord_send'] to listen in the AbstractConnectorAsync class.
  • discord_client.py: Entry point for the Discord transport service.

telegram/

  • Dockerfile: Docker configuration for the Telegram bot service.
  • abc_handler: Module directory of original abc_handler for handling messages and connections.
    • config_queue.py: Defined sources names for queues ['telegram_send'] to listen in the AbstractConnectorAsync class.
  • telegram_client.py: Entry point for the Telegram transport service.

bot_async_factory's People

Contributors

vzip avatar

Stargazers

 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.