mirror of
https://github.com/deesiigneer/pyspapi.git
synced 2026-04-20 12:35:26 +00:00
refactor: replace get_event_loop with asyncio.run for better async handling in example scripts
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import asyncio
|
||||
from pyspapi import SPAPI
|
||||
from asyncio import get_event_loop
|
||||
|
||||
spapi = SPAPI(card_id='CARD_ID', token='TOKEN')
|
||||
spapi = SPAPI(card_id="CARD_ID", token="TOKEN")
|
||||
|
||||
# print(spapi.webhook_verify(data='webhook_data', header='webhook_header'))
|
||||
|
||||
|
||||
async def main():
|
||||
print(await spapi.update_webhook(url='https://example.com/webhook'))
|
||||
print(await spapi.update_webhook(url="https://example.com/webhook"))
|
||||
|
||||
loop = get_event_loop()
|
||||
loop.run_until_complete(main())
|
||||
|
||||
asyncio.run(main())
|
||||
|
||||
Reference in New Issue
Block a user