Version 1.0.1 #12
Closed
nazarovctrl
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Java documentation
Library link in Maven Central
Maven dependency
How to use library?
required steps
1.Add annotation @EnableTelegramLongPollingBot or @EnableTelegramWebhookBot$\textcolor{red}{\textsf{*}}$
Use
@EnableTelegramLongPollingBot
annotation for creating telegram bot withoutwebhook
Use
@EnableTelegramWebhookBot
annotation for telegram bot withwebhook
2.Inherit from @updatecontroller abstract class$\textcolor{red}{\textsf{*}}$
Override
handle
methodMake your class as a
bean
. In previous picture was used@Service
annonation for making the class as abean
3.Add bot configuration to application.properties$\textcolor{red}{\textsf{*}}$
is always required field
bot.name
your telegram bot usernamebot.token
your telegram bot tokenIf you are creating telegram bot with
webhook
you need to addbot.uri
otherwise you don't need4.Send messages(text,media etc.) with MessageSender
Inject
MessageSender
Use
execute
method ofMessageSender
This discussion was created from the release Version 1.0.1.
Beta Was this translation helpful? Give feedback.
All reactions