Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def event(self, func):
- async def wrapper():
- while True:
- event = await self.ws.recv()
- event = json.loads(event)
- if event['t'] == func.__name__:
- func(event)
- asyncio.get_event_loop().run_until_complete(wrapper())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement