Available methods

getChatGifts()

Returns the gifts owned by a chat. Returns OwnedGifts on success.

parameters

parametertyperequireddescription
chat_idnumber | stringrequiredUnique identifier for the target chat or username of the target channel in the format @username
exclude_unsavedbooleanoptionalPass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel.
exclude_savedbooleanoptionalPass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel.
exclude_unlimitedbooleanoptionalPass True to exclude gifts that can be purchased an unlimited number of times
exclude_limited_upgradablebooleanoptionalPass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
exclude_limited_non_upgradablebooleanoptionalPass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
exclude_from_blockchainbooleanoptionalPass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
exclude_uniquebooleanoptionalPass True to exclude unique gifts
sort_by_pricebooleanoptionalPass True to sort results by gift price instead of send date. Sorting is applied before pagination.
offsetstringoptionalOffset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
limitnumberoptionalThe maximum number of gifts to be returned; 1-100. Defaults to 100.

returns

OwnedGifts

usage in yaebal

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

bot.ts
import type { GetChatGiftsParams, OwnedGifts } from "@yaebal/types";

await bot.api.call<OwnedGifts>("getChatGifts", {
  chat_id: 123456789,
} satisfies GetChatGiftsParams);

context shortcut

also available as ctx.getChatGifts() on 16 context types — see @yaebal/contexts.

context shortcut
/** Returns the gifts owned by a chat. Returns [OwnedGifts](https://core.telegram.org/bots/api/#ownedgifts) on success. */
ctx.getChatGifts(params: Omit<GetChatGiftsParams, "chat_id">)