1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 09:07:12 +00:00
tgbotapi/TelegramBotAPI-extensions-api
2020-02-17 15:25:08 +06:00
..
src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api now LiveLocation is deprecated in TelegramBotAPI and placed into TelegramBotAPI-extensions-api 2020-02-15 16:19:12 +06:00
build.gradle now for extensions api system environment will be checked too 2020-02-17 11:49:48 +06:00
maven.publish.gradle add subproject TelegramBotAPI-extensions-api 2020-02-15 01:23:52 +06:00
mpp_publish_template.json add subproject TelegramBotAPI-extensions-api 2020-02-15 01:23:52 +06:00
publish.gradle add subproject TelegramBotAPI-extensions-api 2020-02-15 01:23:52 +06:00
README.md update README 2020-02-17 15:25:08 +06:00

TelegramBotAPI

Awesome Kotlin Badge Download Maven Central Build Status

What is it?

It is wrapper library for TelegramBotAPI. Here you can find extensions for RequestsExecutor, which are more look like Telegram Bot API requests and in the same time have more obvious signatures to help understand some restrictions in Telegram system.

Compatibility

This library always compatible with original TelegramBotAPI library version

How to implement library?

Common ways to implement this library are presented here. In some cases it will require additional steps like inserting of additional libraries (like kotlin stdlib). In the examples will be used variable telegrambotapi.version, which must be set up by developer. Available versions are presented on bintray, next version is last published:

Download

Maven

Dependency config presented here:

<dependency>
  <groupId>com.github.insanusmokrassar</groupId>
  <artifactId>TelegramBotAPI-extensions-api</artifactId>
  <version>${telegrambotapi-extensions-api.version}</version>
</dependency>

Gradle

To use last versions you will need to add one line in repositories block of your build.gradle:

jcenter() or mavenCentral()

And add next line to your dependencies block:

implementation "com.github.insanusmokrassar:TelegramBotAPI-extensions-api:$telegrambotapi_extensions_api_version"

or for old gradle:

compile "com.github.insanusmokrassar:TelegramBotAPI-extensions-api:$telegrambotapi_extensions_api_version"

Example of usage and comparison with TelegramBotAPI

As said in TelegramBotAPI, it is possible to use next syntax for requests:

val requestsExecutor: RequestsExecutor = ...
requestsExecutor.execute(GetMe())

This library offer a little bit another way for this:

val bot: RequestsExecutor = ...
bot.getMe()

The result type of GetMe (and getMe extension) request is ExtendedBot.