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
ifauthData
is not providedofferError
ifoffer_id
is not providedrequestError
if request fails.
Parameters
offer_id
(str): ID of the offer to cancelauthData
(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