ptgb
A complete Telegram Bot API client for Dart

Gifts

Part of the API Reference.

getAvailableGifts

Future<Json> getAvailableGifts() async => _o(await call('getAvailableGifts'));

Lists all gifts currently purchasable to send to users.

sendGift

Future<bool> sendGift(
    String giftId, {
    int? userId,
    Object? chatId,
    String? text,
    ParseMode? textParseMode,
    List<Json>? textEntities,
    bool? payForUpgrade,
  }) async =>

Sends a gift to a user or channel, optionally paid for in Telegram Stars.

giftPremiumSubscription

Future<bool> giftPremiumSubscription(
    int userId,
    int monthCount,
    int starCount, {
    String? text,
    ParseMode? textParseMode,
    List<Json>? textEntities,
  }) async =>

Gifts a Telegram Premium subscription to a user.

getUserGifts

Future<Json> getUserGifts(
    int userId, {
    bool? excludeUnlimited,
    bool? excludeLimitedUpgradable,
    bool? excludeLimitedNonUpgradable,
    bool? excludeUnique,
    bool? excludeFromBlockchain,
    bool? sortByPrice,
    String? offset,
    int? limit,
  }) async =>

Lists gifts publicly displayed on a user's profile.

getChatGifts

Future<Json> getChatGifts(
    Object chatId, {
    bool? excludeUnlimited,
    bool? excludeLimitedUpgradable,
    bool? excludeLimitedNonUpgradable,
    bool? excludeUnique,
    bool? excludeFromBlockchain,
    bool? sortByPrice,
    String? offset,
    int? limit,
  }) async =>

Lists gifts publicly displayed on a channel chat's profile.