Browse Source
Fix some things from my brief smoketest
pull/132/head
Andrei
6 years ago
No known key found for this signature in database
GPG Key ID: 4D2A02C7D500E9D9
2 changed files with
5 additions and
5 deletions
-
disco/gateway/client.py
-
disco/types/user.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): |
|
|
|
|
|
@ -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)) |
|
|
|