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
Uh oh!
There was an error while loading. Please reload this page.
-
Java documentation
Library link in Maven Central
Maven dependency
How to use library?
required steps1.Add annotation @EnableTelegramLongPollingBot or @EnableTelegramWebhookBot$\textcolor{red}{\textsf{*}}$
Use
@EnableTelegramLongPollingBotannotation for creating telegram bot withoutwebhookUse
@EnableTelegramWebhookBotannotation for telegram bot withwebhook2.Inherit from @updatecontroller abstract class$\textcolor{red}{\textsf{*}}$
Override
handlemethodMake your class as a
bean. In previous picture was used@Serviceannonation for making the class as abean3.Add bot configuration to application.properties$\textcolor{red}{\textsf{*}}$
is always required fieldbot.nameyour telegram bot usernamebot.tokenyour telegram bot tokenIf you are creating telegram bot with
webhookyou need to addbot.uriotherwise you don't need4.Send messages(text,media etc.) with MessageSender
Inject
MessageSenderUse
executemethod ofMessageSenderThis discussion was created from the release Version 1.0.1.
Beta Was this translation helpful? Give feedback.
All reactions