Skip to content

Releases: nazarovctrl/telegram-bot-spring

Version 1.0.8

02 Sep 16:24
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.0.7...1.0.8

Version 1.0.7

02 Sep 14:24
Compare
Choose a tag to compare

What's Changed

  • [Properties] Add spring-configuration-metadata.json with description of properties provided by library by @DaNizz97 in #40

New Contributors

Full Changelog: 1.0.6...1.0.7

Version 1.0.6

06 Apr 19:02
59cc634
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.0.5...1.0.6

Version 1.0.5

19 Jan 12:43
014cc24
Compare
Choose a tag to compare

What's Changed

Telegram bot api version changed to 6.9.0

Full Changelog: 1.0.4...1.0.5

Version 1.0.4

08 Dec 11:08
f1cecc0
Compare
Choose a tag to compare

What's Changed

Working with Local Bot API server added

Full Changelog: 1.0.3...1.0.4

Version 1.0.3

12 Nov 13:49
860979f
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.0.2...1.0.3

Version 1.0.2

10 Sep 06:52
0bb8e22
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.0.1...1.0.2

Version 1.0.1

21 Aug 06:28
cdbd66f
Compare
Choose a tag to compare

Java documentation

Library link in Maven Central

Maven dependency

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

How to use library?

$\textcolor{red}{\textsf{*}}$ required steps

1.Add annotation @EnableTelegramLongPollingBot or @EnableTelegramWebhookBot $\textcolor{red}{\textsf{*}}$

image_2023-08-20_20-52-11
Use @EnableTelegramLongPollingBot annotation for creating telegram bot without webhook
Use @EnableTelegramWebhookBot annotation for telegram bot with webhook

2.Inherit from @updatecontroller abstract class $\textcolor{red}{\textsf{*}}$

image_2023-08-20_21-59-15
Override handle method
Make your class as a bean. In previous picture was used @Service annonation for making the class as a bean

3.Add bot configuration to application.properties $\textcolor{red}{\textsf{*}}$

image_2023-08-20_21-00-24
$\textcolor{red}{\textsf{Red line}}$ is always required field
bot.name your telegram bot username
bot.token your telegram bot token
If you are creating telegram bot with webhook you need to add bot.uri otherwise you don't need

4.Send messages(text,media etc.) with MessageSender

image_2023-08-20_23-48-20
Inject MessageSender
Use execute method of MessageSender
image_2023-08-20_21-15-45