Package io.github.natanimn.telebof
Class BotClient
java.lang.Object
io.github.natanimn.telebof.BotClient
Main class of Telebof library
- Since:
- 3 March 2025
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHandler(Object object) me()voidonBusinessConnection(FilterExecutor executor, UpdateHandler<BusinessConnection> handler) Use this method to register new handler for incomingUpdate.getBusinessConnection()update.voidonBusinessMessage(FilterExecutor executor, UpdateHandler<Message> handler) Use this method to register new handler for incomingUpdate.getBusinessMessage()update.voidonCallback(FilterExecutor executor, UpdateHandler<CallbackQuery> handler) Use this method to register new handler for incomingUpdate.getCallbackQuery()update.voidonChannelPost(FilterExecutor executor, UpdateHandler<Message> handler) Use this method to register new handler for incomingUpdate.getChannelPost()update.voidonChatBoost(FilterExecutor executor, UpdateHandler<ChatBoostUpdated> handler) Use this method to register new handler for incomingUpdate.getChatBoost()update.voidonChatJoinRequest(FilterExecutor executor, UpdateHandler<ChatJoinRequest> handler) Use this method to register new handler for incomingUpdate.getChatJoinRequest()update.voidonChatMember(FilterExecutor executor, UpdateHandler<ChatMemberUpdated> handler) Use this method to register new handler for incomingUpdate.getChatMember()update.voidonChosenInlineResult(FilterExecutor executor, UpdateHandler<ChosenInlineResult> handler) Use this method to register new handler for incomingUpdate.getChosenInlineResult()update.voidonDeletedBusinessMessage(FilterExecutor executor, UpdateHandler<BusinessMessagesDeleted> handler) Use this method to register new handler for incomingUpdate.getDeletedBusinessMessages()update.voidonEditedBusinessMessage(FilterExecutor executor, UpdateHandler<Message> handler) Use this method to register new handler for incomingUpdate.getEditedBusinessMessage()update.voidonEditedChannelPost(FilterExecutor executor, UpdateHandler<Message> handler) Use this method to register new handler for incomingUpdate.getEditedChannelPost()update.voidonEditedMessage(FilterExecutor executor, UpdateHandler<Message> handler) Use this method to register new handler for incomingUpdate.getEditedMessage()update.voidonInline(FilterExecutor executor, UpdateHandler<InlineQuery> handler) Use this method to register new handler for incomingUpdate.getInlineQuery()update.voidonMessage(FilterExecutor executor, UpdateHandler<Message> handler) Use this method to register new handler for incomingUpdate.getMessage()update.voidonMyChatMember(FilterExecutor executor, UpdateHandler<ChatMemberUpdated> handler) Use this method to register new handler for incomingUpdate.getMyChatMember()update.voidonPoll(FilterExecutor executor, UpdateHandler<Poll> handler) Use this method to register new handler for incomingUpdate.getPoll()update.voidonPollAnswer(FilterExecutor executor, UpdateHandler<PollAnswer> handler) Use this method to register new handler for incomingUpdate.getPollAnswer()update.voidonPreCheckout(FilterExecutor executor, UpdateHandler<PreCheckoutQuery> handler) Use this method to register new handler for incomingUpdate.getPreCheckoutQuery()update.voidonPurchasedPaidMedia(FilterExecutor executor, UpdateHandler<PaidMediaPurchased> handler) Use this method to register new handler for incomingUpdate.getPurchasedPaidMedia()update.voidonReaction(FilterExecutor executor, UpdateHandler<MessageReactionUpdated> handler) Use this method to register new handler for incomingUpdate.getMessageReaction()update.voidonReactionCount(FilterExecutor executor, UpdateHandler<MessageReactionCountUpdated> handler) Use this method to register new handler for incomingUpdate.getMessageReactionCount()update.voidonRemovedChatBoost(FilterExecutor executor, UpdateHandler<ChatBoostRemoved> handler) Use this method to register new handler for incomingUpdate.getRemovedChatBoost()update.voidonShipping(FilterExecutor executor, UpdateHandler<ShippingQuery> handler) Use this method to register new handler for incomingUpdate.getShippingQuery()update.voidprocessUpdates(List<Update> updates) Process updates retrieved from long polling or webhookvoidUse this method to run the bot using long pollingvoidstop()Stop the bot
-
Field Details
-
context
-
-
Constructor Details
-
BotClient
-
-
Method Details
-
onMessage
Use this method to register new handler for incomingUpdate.getMessage()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onCallback
Use this method to register new handler for incomingUpdate.getCallbackQuery()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onInline
Use this method to register new handler for incomingUpdate.getInlineQuery()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onPoll
Use this method to register new handler for incomingUpdate.getPoll()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onMyChatMember
Use this method to register new handler for incomingUpdate.getMyChatMember()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onPollAnswer
Use this method to register new handler for incomingUpdate.getPollAnswer()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onPreCheckout
Use this method to register new handler for incomingUpdate.getPreCheckoutQuery()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onChatMember
Use this method to register new handler for incomingUpdate.getChatMember()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onEditedMessage
Use this method to register new handler for incomingUpdate.getEditedMessage()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onChannelPost
Use this method to register new handler for incomingUpdate.getChannelPost()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onEditedChannelPost
Use this method to register new handler for incomingUpdate.getEditedChannelPost()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onChatJoinRequest
Use this method to register new handler for incomingUpdate.getChatJoinRequest()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onChosenInlineResult
public void onChosenInlineResult(FilterExecutor executor, UpdateHandler<ChosenInlineResult> handler) Use this method to register new handler for incomingUpdate.getChosenInlineResult()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onShipping
Use this method to register new handler for incomingUpdate.getShippingQuery()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onReaction
Use this method to register new handler for incomingUpdate.getMessageReaction()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onReactionCount
public void onReactionCount(FilterExecutor executor, UpdateHandler<MessageReactionCountUpdated> handler) Use this method to register new handler for incomingUpdate.getMessageReactionCount()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onChatBoost
Use this method to register new handler for incomingUpdate.getChatBoost()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onRemovedChatBoost
Use this method to register new handler for incomingUpdate.getRemovedChatBoost()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onBusinessConnection
public void onBusinessConnection(FilterExecutor executor, UpdateHandler<BusinessConnection> handler) Use this method to register new handler for incomingUpdate.getBusinessConnection()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onBusinessMessage
Use this method to register new handler for incomingUpdate.getBusinessMessage()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onEditedBusinessMessage
Use this method to register new handler for incomingUpdate.getEditedBusinessMessage()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onDeletedBusinessMessage
public void onDeletedBusinessMessage(FilterExecutor executor, UpdateHandler<BusinessMessagesDeleted> handler) Use this method to register new handler for incomingUpdate.getDeletedBusinessMessages()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
onPurchasedPaidMedia
public void onPurchasedPaidMedia(FilterExecutor executor, UpdateHandler<PaidMediaPurchased> handler) Use this method to register new handler for incomingUpdate.getPurchasedPaidMedia()update.- Parameters:
executor- pre-defined or user-defined filterhandler- a handler to be executed
-
addHandler
-
stop
public void stop()Stop the bot -
me
-
processUpdates
Process updates retrieved from long polling or webhook- Parameters:
updates- array ofUpdate
-
startPolling
public void startPolling()Use this method to run the bot using long polling
-