Coder Social home page Coder Social logo

telegram_bot_ruby_server's Introduction

BOTServer

Telegram Bot API Webhooks Framework, for Rubyists.
BOTServer configures, tests and deploys bots, running a fast rack server for webhooks routing.

Architecture:

  TELEGRAM Bot API Server                         
 --------------------------------------------------------------------
   v v v                                                       ^ ^ ^
   | | |                                                       | | |
   | | |    SSL/HTTPS                                          | | | 
   | | |    front-end       BOTServer                          | | |
   | | |    +-------+       Rack router                        | | |
   | | |    |       |       +------+                           | | |
   | | |    |       |       |      |     +-------+ HTTPS send  | | |
   | | |    |       |       |      |---->| App 1 |-------------+ | |
   | | |    |       | HTTP  |      |     +-------+               | |
   | | |    |       | POST  |      |                             | |
   | | +--->|       |------>|      |     +-------+ HTTPS send    | |
   | +----->|       |------>|      |---->| App 2 |---------------+ |
   +------->|       |------>|      |     +-------+                 |
   webhooks |       |       |      |                               |
 HTTPS POST |       |       |      |     +-------+  HTTPS send     |
            |       |       |      |---->| App   |-----------------+
            |       |       | Thin |     +-------+
            | NGINX |       +------+
            +-------+       

BOTServer is a devops utility to:

  • set-up and test tokens/webhooks
  • generate a template app for each bot
  • run a webhooks router/server.

Here assembly instruction steps:

  1. Installation (web/proxy server, Ruby project code)
  2. Get Telegram Bot token(s)
  3. Update configuration files
  4. Create (self-signed) Certificate
  5. Configure "Webhooks mode" for each token
  6. Generate template for each bot
  7. Deploy and run _BOTServer
$ rake
rake app:new[token]        # Create bot app template for given token
rake certificate:new       # Create SSL certificate
rake certificate:show      # Show public certificate
rake proxy:config:new      # Generate nginx proxy SSL configuration from server.yml data
rake proxy:restart         # Restart proxy server
rake proxy:start           # Start proxy server
rake proxy:stop            # Stop proxy server
rake server:config:show    # Show server configuration: /home/solyaris/BOTServer/config/server.yml
rake server:config:test    # Check server configuration: /home/solyaris/BOTServer/config/server.yml
rake server:log            # Tail -f rack sever logfile: /home/solyaris/BOTServer/log/thin.log
rake server:pid            # Show rack server pid
rake server:restart        # Restart rack server
rake server:start          # Start rack server
rake server:stop           # Stop rack server
rake tokens:show           # Show tokens configuration file: /home/solyaris/BOTServer/config/tokens.yml
rake tokens:test           # Verify if tokens are valid, online querying Telegram Server
rake webhook:reset[token]  # Reset webhook for a given token
rake webhook:set[token]    # Set webhook for a given token

Credits/Contributing/Contact

Commands

"Покушать" "Бургер" "Сэндвич" "Поработать" "За компьютером" "Назад"

telegram_bot_ruby_server's People

Contributors

kagayakashi 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.