Skip to content

Instantly share code, notes, and snippets.

@rubenlagus
Last active January 6, 2023 14:27
Show Gist options
  • Save rubenlagus/8232109d9b713a37c56e8017cbff2fa0 to your computer and use it in GitHub Desktop.
Save rubenlagus/8232109d9b713a37c56e8017cbff2fa0 to your computer and use it in GitHub Desktop.

Telegram bot redesign

Licensing

MIT

Versioning

major.minor.patch

The first three correspont to the major and minor version of the bot api. The patch version van be used for interim library released for hotfixes or adding features. This decouples the library release cycle from the telegram release cycle

Modules

Meta

Contains just the raw telegram data classes. Can be used as a basis for others to implement custom telegram clients

Client

A telegram client using the bindings, does requesting, parsing, etc. This should include a httpclient facade in order to be independant of actual http client implementation. The client can be provided by the user or use the java native http client as a fallback. Can be used if a custom bot implementation is needed

Common

The basic infrastructure for building a bot. UpdateSupplier interface, UpdateDistributor etc.

webhook

UpdateSupplier implemented using an embedded server and webhook

Longpolling

UpdateSupplier implemented using longpolling

spring-webhook

Webhook UpdateSupplier using spring controllers and DependencyInjection

spring-longpolling

LongPolling UpdateSupplier using spring DependencyInjection

extensions

Miscalanious extensions for example for Sessions or Command Parsing

Abilities

the existing abilities framework

Core Dependencies

Code generation:

Rest API:

HTTP Client:

Spring:

Testing:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment