Skip to content

alserom/telegram-bot-api-spec

Repository files navigation

Telegram Bot API specification Bot API version

Validation status Scraping status

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 😫).

About files

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 😉

Data type definitions

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 type Message.
  • array<Message|string> - this means that EACH SEPARATE ITEM of this array can be the type Message or a type string.
  • array<> or array - this means that EACH SEPARATE ITEM of this array can be of any type.

Links

Check these resources to find out what is Telegram Bots and how to work with them.

Alternatives

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.

Contributing

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.

License

Licence