This repository contains Telegram Bot API specifications in a comfortable format for autogenerating any kind of telegram-bot-related libs and modules.
Automatically checking for any changes in official docs runs every day at 20:00 UTC. In case of any update is detected - this repository will be updated too (as soon as someone will check, approve & merge automatically created PR 😫).
File | Description |
---|---|
spec.json | Description of Telegram Bot API docs as JSON specification in a custom format. Check out the spec.schema.json document to understand the format. Also, check notes about Data type definitions. |
spec.min.json | A compressed version of the spec.json file. |
spec.schema.json | JSON Schema document to annotate and validate spec.json & spec.min.json . |
openapi.json | Description of Telegram Bot API docs as OpenAPI specification. Uses OAS 3.1.0 . |
openapi.min.json | A compressed version of the openapi.json file. |
version.json | Holds the current Bot API version under the version key. Nothing more. Can be used to show a pretty badge 😉 |
This notes regards data types used in the
spec.json
specification.
Here how possible data types are described.
Scalars:
string
int32
int64
float
boolean
Objects: Just an object name that starts with a capital letter. E.g. User
, Chat
, Message
, etc.
Arrays: Describes in format array<type|type2|typeN>
. For example:
array<Message>
- this means that EACH ITEM of this array has the typeMessage
.array<Message|string>
- this means that EACH SEPARATE ITEM of this array can be the typeMessage
or a typestring
.array<>
orarray
- this means that EACH SEPARATE ITEM of this array can be of any type.
Check these resources to find out what is Telegram Bots and how to work with them.
- Official Telegram docs - Bots: An introduction for developers
- Official Telegram docs - Detailed Guide to Bot Features
- Official Telegram docs - Full API Reference for Developers
Here are some alternatives which inspire me to create this repository. They are pretty good but do not meet my needs, so maybe you will be interested.
- PaulSonOfLars/telegram-bot-api-spec
Repository with a simple JSON description of the telegram bot API which updates itself every day. Also, have a scraper written in Python. - sys-001/telegram-bot-api-versions
Repository with schemas for all versions of the Telegram bot API. Contains schemas inpostman
,openapi
, andcustom
JSON formats.
If you want to improve this repository, feel free to create PRs and open issues to discuss what you would like to improve or change.
Also, take a look at the alserom/tg-bot-api-spec tool that is used to generate spec files. In most cases, changes regarding spec files should be applied to this tool.