just-ai/jaicf-kotlin

Telegram buttons

Denire opened this issue · 1 comments

Problem:
In Reaction.kt we have method:

open fun buttons(vararg buttons: String) {}

This method adds buttons to response, but telegram does not support adding buttons by separate reaction, so when user reacts with buttons in telegram channel, nothing happens.

Solution:
We can modify buttons in TelegramReaction to edit last response and add buttons to last response. Thus allowing using following code in TelegramChannel like in synchronous channels:

action {
  reactions.say("What number do you pick?")
  reactions.buttons("1", "2", "3")
}

@Denire isn't it one more argument for extracting buttons, image, audio, and other "might not be supported" reactions from base Reactions.kt?