getUserGifts()
Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.
parameters
| parameter | type | required | description |
|---|---|---|---|
user_id | number | required | Unique identifier of the user |
exclude_unlimited | boolean | optional | Pass True to exclude gifts that can be purchased an unlimited number of times |
exclude_limited_upgradable | boolean | optional | Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique |
exclude_limited_non_upgradable | boolean | optional | Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique |
exclude_from_blockchain | boolean | optional | Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram |
exclude_unique | boolean | optional | Pass True to exclude unique gifts |
sort_by_price | boolean | optional | Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. |
offset | string | optional | Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results |
limit | number | optional | The maximum number of gifts to be returned; 1-100. Defaults to 100. |
returns
usage in yaebal
not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.
import type { GetUserGiftsParams, OwnedGifts } from "@yaebal/types";
await bot.api.call<OwnedGifts>("getUserGifts", {
user_id: 123456789,
} satisfies GetUserGiftsParams);context shortcut
also available as ctx.getUserGifts() on
16
context types — see @yaebal/contexts.
/** Returns the gifts owned and hosted by a user. Returns [OwnedGifts](https://core.telegram.org/bots/api/#ownedgifts) on success. */
ctx.getUserGifts(params: Omit<GetUserGiftsParams, "user_id">)official Bot API docs: https://core.telegram.org/bots/api/#getusergifts