ptgb
A complete Telegram Bot API client for Dart

Callback Queries

Part of the API Reference.

answerCallbackQuery

Future<bool> answerCallbackQuery(
    String callbackQueryId, {
    String? text,
    bool? showAlert,
    String? url,
    int? cacheTime,
  }) async =>

Responds to a button press from an [InlineKeyboardButton.callback] button.

You should call this for every callback query you receive, even with no arguments, so Telegram stops showing a loading spinner on the button. Set [showAlert] to show the response as a popup instead of a toast.

answerGuestQuery

Future<Json> answerGuestQuery(String guestQueryId, Json result) async =>

Answers a query sent by a guest (an unauthenticated user browsing via Guest Mode), delivering [result] back to them. [result] should be shaped like a SentGuestMessage; raw [Json] is used since the shape depends on what kind of content you send back.