Giter Site home page Giter Site logo

annihilatorrrr / telegram-bot-api-spec Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paulsonoflars/telegram-bot-api-spec

0.0 0.0 0.0 552 KB

A simple JSON description of the telegram bot API which updates itself every day.

License: MIT License

Python 100.00%

telegram-bot-api-spec's Introduction

telegram-bot-api-spec

This repo provides the necessary scripts to scrape the telegram bot api docs for method, types, and docstrings.

The main usecase of having this data is expected to be to generate automated libraries which follow the bot api documentation to the letter. Assuming the docs are correct, autogenerated libraries provide the following:

  • Easy to update. Simply re-generate the code using the new JSON spec.
  • Typo free. All methods/fields are guaranteed to be correct.
  • No missing fields. If its in the spec, its in your code!

The output of this script api.json, is formatted as such:

{
  "methods": {
    <method name> : {
      "name": // string, method name
      "href": // string, link to docs
      "returns": // array of string, possible return types
      "description": // array of string, documentation lines
      "fields": [
        {
          "name": // string, field name
          "types": // array of string, possible field types
          "required": // bool, whether field is required
          "description": // string, documentation for field
        },
        ...
      ], // array of fields
      "subtypes": // array of string, all the types that subtype this item (eg, InputMedia has subtypes InputMediaAnimation, InputMediaDocument etc)
      "subtype_of": // array of string, all the "parent" types of this type (eg, InputMediaAnimation is a subtype of InputMedia)
    },
    ...
  }, // map of method name -> method details
  "types": {
    <type name> : {
      "name": // string, type name
      "href": // string, link to docs
      "description": // array of string, documentation lines
      "fields": [
        {
          "name": // string, field name
          "types": // array of string, possible field types
          "required": // bool, whether field is required
          "description": // string, documentation for field
        },
        ...
      ], // array of type fields
    },
    ...  
  } // map of type name -> type details
}

telegram-bot-api-spec's People

Contributors

github-actions[bot] avatar paulsonoflars avatar mammad900 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.