Interface Event
- All Known Subinterfaces:
CancellableEvent, GroupBotEvent, MessageEvent
- All Known Implementing Classes:
BotJoinGroupEvent, BotQuitGroupEvent, BotShutdownEvent, ButtonPressEvent, ChannelSendMessageEvent, MethodSendEvent, SelfJoinGroupEvent, SelfQuitGroupEvent, UpdateReceivedEvent, UserInlineQueryReceivedEvent, UserJoinGroupEvent, UserMessageReceivedEvent, UserQuitGroupEvent
public interface Event
Basic interface for an event.
-
Method Summary
Modifier and TypeMethodDescription@NotNull TelegramBotbot()Gets the Bot instance associated with the event.default <R extends Serializable>
@NotNull CompletableFuture<R> Executes an API method.
-
Method Details
-
bot
Gets the Bot instance associated with the event.- Returns:
- the Bot instance associated with the event
-
execute
@NotNull default <R extends Serializable> @NotNull CompletableFuture<R> execute(@NotNull @NotNull ApiMethod<R> method) Executes an API method.- Parameters:
method- the API method to be executed- Returns:
- a CompletableFuture that will complete with the result of the API method execution
-