diff --git a/disco/gateway/client.py b/disco/gateway/client.py index 58ccc5b..a0884fd 100644 --- a/disco/gateway/client.py +++ b/disco/gateway/client.py @@ -78,7 +78,7 @@ class GatewayClient(LoggingClass): self.log.debug('GatewayClient.send %s', op) self.packets.emit((SEND, op), data) self.ws.send(self.encoder.encode({ - 'op': op.value, + 'op': op, 'd': data, }), self.encoder.OPCODE) @@ -188,7 +188,7 @@ class GatewayClient(LoggingClass): self.seq = data['s'] # Emit packet - self.packets.emit((RECV, OPCode[data['op']]), data) + self.packets.emit((RECV, data['op']), data) def on_error(self, error): if isinstance(error, KeyboardInterrupt): diff --git a/disco/types/user.py b/disco/types/user.py index 181de34..1bbd9d3 100644 --- a/disco/types/user.py +++ b/disco/types/user.py @@ -1,4 +1,4 @@ -from disco.types.base import SlottedModel, Field, snowflake, text, with_equality, with_hash +from disco.types.base import SlottedModel, Field, snowflake, text, with_equality, with_hash, enum class DefaultAvatars(object): @@ -70,7 +70,7 @@ class Status(object): class Game(SlottedModel): - type = Field(GameType) + type = Field(enum(GameType)) name = Field(text) url = Field(text) @@ -78,4 +78,4 @@ class Game(SlottedModel): class Presence(SlottedModel): user = Field(User, alias='user', ignore_dump=['presence']) game = Field(Game) - status = Field(Status) + status = Field(enum(Status))