diff --git a/litecord/blueprints/icons.py b/litecord/blueprints/icons.py index 106e80e..7434bad 100644 --- a/litecord/blueprints/icons.py +++ b/litecord/blueprints/icons.py @@ -81,7 +81,7 @@ async def _get_guild_splash(guild_id: int, icon_file: str): return await send_icon('splash', guild_id, icon_hash, ext=ext) -@bp.route('/banners//', methods=['GET']) +@bp.route('/banners//', methods=['GET']) async def _get_guild_banner(guild_id: int, icon_file: str): icon_hash, ext = splitext_(icon_file) return await send_icon('banner', guild_id, icon_hash, ext=ext) diff --git a/litecord/gateway/websocket.py b/litecord/gateway/websocket.py index c2977b7..4cc22aa 100644 --- a/litecord/gateway/websocket.py +++ b/litecord/gateway/websocket.py @@ -74,7 +74,16 @@ def decode_json(data: str): def encode_etf(payload) -> str: - return earl.pack(payload) + # The thing with encoding ETF is that with json we have LitecordJSONEncoder + # which takes care of converting e.g datetime objects to their ISO + # representation. + + # so, to keep things working, i'll to a json pass on the payload, then send + # the decoded payload back to earl. + + sanitized = encode_json(payload) + sanitized = decode_json(sanitized) + return earl.pack(sanitized) def _etf_decode_dict(data):