bots.UpdateStarRefProgram

class pyrogram.raw.functions.bots.UpdateStarRefProgram

Create, edit or delete the affiliate program of a bot we own

Details:
  • Layer: 223

  • ID: 778B5AB3

Parameters:
  • bot (InputUser) – The bot

  • commission_permille (int 32-bit) – The permille commission rate: it indicates the share of Telegram Stars received by affiliates for every transaction made by users they referred inside of the bot. The minimum and maximum values for this parameter are contained in the starref_min_commission_permille and starref_max_commission_permille client configuration parameters. Can be 0 to terminate the affiliate program. Both the duration and the commission may only be raised after creation of the program: to lower them, the program must first be terminated and a new one created.

  • duration_months (int 32-bit, optional) – Indicates the duration of the affiliate program; if not set, there is no expiration date.

Returns:

StarRefProgram

TL Schema

bots.updateStarRefProgram#778b5ab3
flags:#
bot:InputUser
commission_permille:int
duration_months:flags.0?int

= StarRefProgram

Parameter Tree

UpdateStarRefProgram
├── botInputUser
│ ├── InputUserEmpty
│ ├── InputUserSelf
│ ├── InputUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ └── InputUserFromMessage
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── user_idlong
├── commission_permilleint
└── duration_monthsint (optional)

Example

await app.invoke(
    UpdateStarRefProgram(
        bot=await app.resolve_user(chat_id),
        commission_permille=0,
        duration_months=0,
    )
)