Gateway implementation for the Wumpy project.
Wumpy-gateway is available as a package on PyPI. Just use your favourite package manager such as pip or Poetry:
# Installing from PyPI using pip:
pip install wumpy-gateway
# Alternatively, using Poetry:
poetry add wumpy-gateway
The API of wumpy-gateway is very simple:
from wumpy.gateway import Shard
INTENTS = 65535
TOKEN = 'ABC123.XYZ789'
async def main():
# Connect to the URI wss://gateway.discord.gg/ with the token
# ABC123.XYZ8789 and all intents.
async with Shard('wss://gateway.discord.gg/', TOKEN, INTENTS) as ws:
async for event in ws:
print(event) # The deserialized JSON event payload