Payments

editUserStarSubscription()

Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.

parameters

parametertyperequireddescription
user_idnumberrequiredIdentifier of the user whose subscription will be edited
telegram_payment_charge_idstringrequiredTelegram payment identifier for the subscription
is_canceledbooleanrequiredPass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.

returns

boolean

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 { EditUserStarSubscriptionParams } from "@yaebal/types";

await bot.api.call<boolean>("editUserStarSubscription", {
  user_id: 123456789,
  telegram_payment_charge_id: "...",
  is_canceled: true,
} satisfies EditUserStarSubscriptionParams);

context shortcut

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

context shortcut
/** Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns *True* on success. */
ctx.editUserStarSubscription(params: Omit<EditUserStarSubscriptionParams, "user_id">)