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 Type
    Method
    Description
    @NotNull TelegramBot
    bot()
    Gets the Bot instance associated with the event.
    default <R extends Serializable>
    @NotNull CompletableFuture<R>
    execute(@NotNull ApiMethod<R> method)
    Executes an API method.
  • Method Details

    • bot

      @NotNull @NotNull TelegramBot 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