Closed aaomidi closed 6 years ago
Implement a callback to be called when a specific InlineResult is called it calls a specific piece of code. This would allow a more fluid "event-driven" approach to making bots rather than using Maps for "ids" of Results on the developer side.
Example:
AnswerInlineQuery answer = AnswerInlineQuery.builder() .queryId(inlineQueryEvent.getQuery().getId()) .addResult( InlineResultArticle.builder() .title("booper") .id(UUID.randomUUID().toString()) .inputMessageContent( InputTextMessageContent.builder() .messageText("boop") .build() ) .build() ) .callback(() -> { System.out.println("No error"); }).errorHandler(e -> System.out.println(e)) .chosenCallback((chosenInlineResult) -> {})) .build();
Implement a callback to be called when a specific InlineResult is called it calls a specific piece of code. This would allow a more fluid "event-driven" approach to making bots rather than using Maps for "ids" of Results on the developer side.
Example: