editOffer

editOffer()

async def editOffer(offer_id: str, new_price: int | float, authData: str) -> None

Edit price of the existing gift offer

Returns

None if price of the offer was changed successfully

Raises

  • authDataError if authData is not provided

  • offerError if offer_id, new_price aren't provided

  • requestError if request fails.

Parameters

  • offer_id (str): ID of the offer

  • new_price (int | float): New price of the offer

  • authData (str): Authentication data required to edit the offer.

Example

Add 0.01 TON to price of all placed offers:

from aportalsmp.offers import myPlacedOffers, editOffer
from aportalsmp.auth import update_auth
import asyncio

auth = asyncio.run(update_auth(api_id=123, api_hash="..."))

async def main():
    placed_offers = await myPlacedOffers(authData = auth)
    for offer in placed_offers:
        await editOffer(offer_id = offer.id, new_price = offer.amount + 0.01, authData = auth)

See used functions: myPlacedOffers, update_auth

Last updated