telegram-bot icon indicating copy to clipboard operation
telegram-bot copied to clipboard

Decide what kind of API we want for inline query result

Open knsd opened this issue 6 years ago • 0 comments

We have both public fields for all structs and a builder for InlineQueryResultArticle right now. I think it be much better to use only builder because telegram can add new fields to types and it would break user code eventually.

  • Maybe InlineQueryResult* builders should take self by value, like InlineKeyboardButton, I'm not sure.
  • Maybe we should change CanAnswerInlineQuery and AnswerInlineQuery API, something like this:
query.answer_inline()
    .add(InlineQueryResultMpeg4Gif::new("unique-id1", "http://example.com/mpeg.mp4"))
    .add(InlineQueryResultMpeg4Gif::new("unique-id2", "http://example.com/mpeg2.mp4"))

knsd avatar Oct 21 '19 08:10 knsd