SendStarGiftOffer
---functions--- payments.sendStarGiftOffer#8fb86b41 peer:InputPeer slug:string price:StarsAmount duration:int random_id:long allow_paid_stars:flags.0?long = Updates
Returns
| Updates |
Parameters
| peer | InputPeer | required |
| slug | string | required |
| price | StarsAmount | required |
| duration | int | required |
| random_id | long | required |
| allow_paid_stars | long | optional |
Example
The examples below use placeholder values. Replace them with real data before running the code.
▶ Minimal
import asyncio
import random
from ferogram import Client, raw
app = Client("my_session", api_id=12345, api_hash="0123456789abcdef0123456789abcdef")
async def main():
await app.start()
result = await app.raw.payments.SendStarGiftOffer(
peer='username',
slug='some string here',
price=raw.types.StarsTonAmount(amount=0),
duration=42,
random_id=random.randrange(-2**63, 2**63)
)
print(result)
asyncio.run(main())
The minimal example uses Ferogram's raw proxy shorthand. Peers can be passed as strings and required primitives get safe defaults. Expand Full API to see every parameter.
▶ Full API
import asyncio
import random
from ferogram import Client, raw
app = Client("my_session", api_id=12345, api_hash="0123456789abcdef0123456789abcdef")
async def main():
await app.start()
result = await app(raw.functions.payments.SendStarGiftOffer(
peer=raw.types.InputPeerSelf(),
slug='some string here',
price=raw.types.StarsTonAmount(amount=0),
duration=42,
random_id=random.randrange(-2**63, 2**63),
allow_paid_stars=-12398745604826
))
print(result)
asyncio.run(main())