grampa-generate

Generate a Telegram Bot API client on-the-go! 🏃

Usage no npm install needed!

<script type="module">
  import grampaGenerate from 'https://cdn.skypack.dev/grampa-generate';
</script>

README

grampa-generate

Generate a Telegram Bot API client on-the-go! 🏃

Version Downloads Dependencies License oclif

AboutFeaturesUsageCommandsLicense

About

I've made this tool for grampa, but feel free to use it for your own bot framework or whatever 😁

grampa-generate is a command line tool that scrapes the Telegram Bot API docs and generates a lightweight, dependency-free Telegram API Client directly from the documentation.
This ensures that the available methods and types are (almost) always up-to-date!
No need to check the docs everytime! 😊

Features

  • Always stay up-to-date with the Telegram Bot API
  • Uses HTTP/2 for API requests, which makes everything a bit faster! 🏎
  • No custom methods, update polling, or anything - just a pure Telegram Bot API client, making this the perfect foundation for your own bot framework! 🏗

Usage

$ npm install -g grampa-generate
$ grampa-generate COMMAND
running command...
$ grampa-generate (-v|--version|version)
grampa-generate/1.0.4 win32-x64 node-v14.16.0
$ grampa-generate --help [COMMAND]
USAGE
  $ grampa-generate COMMAND
...
$ npm install -g grampa-generate
$ grampa-generate COMMAND
running command...
$ grampa-generate (-v|--version|version)
grampa-generate/1.0.0 win32-x64 node-v14.16.0
$ grampa-generate --help [COMMAND]
USAGE
  $ grampa-generate COMMAND
...

Commands

grampa-generate help [COMMAND]

display help for grampa-generate

USAGE
  $ grampa-generate help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

grampa-generate json [OUTFILE]

Generate a JSON representation of the internal objects used by grampa-generate.

USAGE
  $ grampa-generate json [OUTFILE]

ARGUMENTS
  OUTFILE  Write the generator output to this file.
           If omitted, the generator prints to stdout.

OPTIONS
  -f, --force   When writing output to a file, overwrite file, if it already exists.
  -h, --help    show CLI help
  -p, --pretty  Prettify JSON output.

grampa-generate typescript [OUTFILE]

Generate a Typescript client for the Telegram Bot API.

USAGE
  $ grampa-generate typescript [OUTFILE]

ARGUMENTS
  OUTFILE  Write the generator output to this file.
           If omitted, the generator prints to stdout.

OPTIONS
  -e, --eventemitter  Add an EventEmitter which helps when building bot frameworks.
  -f, --force         When writing output to a file, overwrite file, if it already exists.
  -h, --help          show CLI help

grampa-generate typescript-types [OUTFILE]

Generate Typescript type definitions for the Telegram Bot API.

USAGE
  $ grampa-generate typescript-types [OUTFILE]

ARGUMENTS
  OUTFILE  Write the generator output to this file.
           If omitted, the generator prints to stdout.

OPTIONS
  -c, --class  Add a Class with all the method definitions in the output.
  -f, --force  When writing output to a file, overwrite file, if it already exists.
  -h, --help   show CLI help

grampa-generate help [COMMAND]

display help for grampa-generate

USAGE
  $ grampa-generate help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

grampa-generate json [OUTFILE]

Generate a JSON representation of the internal objects used by grampa-generate.

USAGE
  $ grampa-generate json [OUTFILE]

ARGUMENTS
  OUTFILE  Write the generator output to this file.
           If omitted, the generator prints to stdout.

OPTIONS
  -f, --force   When writing output to a file, overwrite file, if it already exists.
  -h, --help    show CLI help
  -p, --pretty  Prettify JSON output.

grampa-generate typescript [OUTFILE]

Generate a Typescript client for the Telegram Bot API.

USAGE
  $ grampa-generate typescript [OUTFILE]

ARGUMENTS
  OUTFILE  Write the generator output to this file.
           If omitted, the generator prints to stdout.

OPTIONS
  -f, --force  When writing output to a file, overwrite file, if it already exists.
  -h, --help   show CLI help

grampa-generate typescript-types [OUTFILE]

Generate Typescript type definitions for the Telegram Bot API.

USAGE
  $ grampa-generate typescript-types [OUTFILE]

ARGUMENTS
  OUTFILE  Write the generator output to this file.
           If omitted, the generator prints to stdout.

OPTIONS
  -c, --class  Add a Class with all the method definitions in the output.
  -f, --force  When writing output to a file, overwrite file, if it already exists.
  -h, --help   show CLI help

License

grampa-generate is licensed under the MIT License.
The generated Telegram Bot API client is licensed under the WTFPL License. ❤