cancelOffer

cancelOffer()

async def cancelOffer(offer_id: str, authData: str) -> None

Cancel existing gift offer

Returns

None if the offer was cancelled successfully

Raises

  • authDataError if authData is not provided

  • offerError if offer_id is not provided

  • requestError if request fails.

Parameters

  • offer_id (str): ID of the offer to cancel

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

Example

Cancel all existing offers:

from aportalsmp.offers import myPlacedOffers, cancelOffer
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 cancelOffer(offer_id = offer.id, authData = auth)

See used functions: myPlacedOffers, update_auth

Last updated