Skip to content

Commit

Permalink
Update README.md for version 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarovctrl authored Sep 10, 2023
1 parent f4d45b9 commit 0bb8e22
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,63 @@
## [Java documentation](https://javadoc.io/doc/io.github.nazarovctrl/telegram-bot-spring)
## Library [link](https://central.sonatype.com/artifact/io.github.nazarovctrl/telegram-bot-spring/) in Maven Central
## [Java documentation](https://javadoc.io/doc/io.github.nazarovctrl/telegram-bot-spring/1.0.2)
## Library [link](https://central.sonatype.com/artifact/io.github.nazarovctrl/telegram-bot-spring/1.0.2) in Maven Central
## Maven dependency

<dependency>
<groupId>io.github.nazarovctrl</groupId>
<artifactId>telegram-bot-spring</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
</dependency>

## How to use library?
#### $\textcolor{red}{\textsf{*}}$ `required steps`

<details close>
<summary>
<summary>
<h4>
1.Add annotation <tt><b>@EnableTelegramLongPollingBot</b></tt> or <tt><b>@EnableTelegramWebhookBot</b></tt>
$\textcolor{red}{\textsf{*}}$
1.Add <i>bot configuration</i> to <tt><b>application.properties</b></tt>
$\textcolor{red}{\textsf{*}}$
</h4>
</summary>
<kbd>
<img width="616" alt="image_2023-08-20_20-52-11" src="https://github.com/nazarovctrl/telegram-bot-spring/assets/109890132/75910725-fd48-4400-9fb0-e06b1dc99e44">
<img width="454" alt="image_2023-08-20_21-00-24" src="https://github.com/nazarovctrl/telegram-bot-spring/assets/109890132/9dee056e-6e08-42c3-8b06-06e42f96536b">
</kbd>

##### Use `@EnableTelegramLongPollingBot` annotation for creating telegram bot ***without*** `webhook`
##### Use `@EnableTelegramWebhookBot` annotation for telegram bot ***with*** `webhook`

##### $\textcolor{red}{\textsf{Red line}}$ `is always required field`
##### `bot.name` your telegram bot username
##### `bot.token` your telegram bot token
##### `bot.uri` uri to send a request to your application.

##### If you are creating telegram bot with `webhook` you need to add `bot.uri` otherwise you don't need

</details>

<details close>
<summary>
<h4>
2.Inherit from <tt><b>@UpdateController</b></tt> abstract class
2.Add annotation <tt><b>@EnableTelegramLongPollingBot</b></tt> or <tt><b>@EnableTelegramWebhookBot</b></tt>
$\textcolor{red}{\textsf{*}}$
</h4>
</summary>
<kbd><img width="518" alt="image_2023-08-20_21-59-15" src="https://github.com/nazarovctrl/telegram-bot-spring/assets/109890132/a0da8d98-a916-4e6e-a2f7-549af31fa615"></kbd>
<kbd>
<img width="616" alt="image_2023-08-20_20-52-11" src="https://github.com/nazarovctrl/telegram-bot-spring/assets/109890132/75910725-fd48-4400-9fb0-e06b1dc99e44">
</kbd>

##### Use `@EnableTelegramLongPollingBot` annotation for creating telegram bot ***without*** `webhook`
##### Use `@EnableTelegramWebhookBot` annotation for telegram bot ***with*** `webhook`

##### Override `handle` method
##### Make your class as a `bean`. _In previous picture was used `@Service` annonation for making the class as a `bean`_
</details>

<details close>
<summary>
<summary>
<h4>
3.Add <i>bot configuration</i> to <tt><b>application.properties</b></tt>
$\textcolor{red}{\textsf{*}}$
3.Inherit from <tt><b>@AbstractUpdateController</b></tt> abstract class
$\textcolor{red}{\textsf{*}}$
</h4>
</summary>
<kbd>
<img width="454" alt="image_2023-08-20_21-00-24" src="https://github.com/nazarovctrl/telegram-bot-spring/assets/109890132/9dee056e-6e08-42c3-8b06-06e42f96536b">
<kbd><img width="750" alt="image" src="https://github.com/nazarovctrl/telegram-bot-spring/assets/109890132/f77b4c72-b1af-4530-933a-152dc826f3a8">
</kbd>

##### $\textcolor{red}{\textsf{Red line}}$ `is always required field`
##### `bot.name` your telegram bot username
##### `bot.token` your telegram bot token
##### `bot.uri` uri to send a request to your application.

##### If you are creating telegram bot with `webhook` you need to add `bot.uri` otherwise you don't need

##### Override `handle` method
##### Make your class as a `bean`. _In previous picture was used `@Component` annonation for making the class as a `bean`_
</details>

<details close>
Expand Down

0 comments on commit 0bb8e22

Please sign in to comment.