From 8774e1314c7e17e404e876eea84ea2385f8b0322 Mon Sep 17 00:00:00 2001 From: mini <39670899+minisbett@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:30:31 +0100 Subject: [PATCH 1/2] Fix timestamp not parsing properly --- app/discord.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/discord.py b/app/discord.py index 7725a4e18..42f370710 100644 --- a/app/discord.py +++ b/app/discord.py @@ -1,6 +1,8 @@ """Functionality related to Discord interactivity.""" from __future__ import annotations +import orjson + from typing import Any from tenacity import retry @@ -168,7 +170,7 @@ def json(self) -> Any: payload["embeds"].append(embed_payload) - return payload + return orjson.dumps(payload, default=str).decode() @retry( stop=stop_after_attempt(10), @@ -181,7 +183,7 @@ async def post(self) -> None: headers = {"Content-Type": "application/json"} response = await services.http_client.post( self.url, - json=self.json, + content=self.json, headers=headers, ) response.raise_for_status() From 4c5024a3d8a3ea079a8c6ef7eaf2aaec65c887f7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 20:31:24 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- app/discord.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/discord.py b/app/discord.py index 42f370710..d8f106ff3 100644 --- a/app/discord.py +++ b/app/discord.py @@ -1,10 +1,9 @@ """Functionality related to Discord interactivity.""" from __future__ import annotations -import orjson - from typing import Any +import orjson from tenacity import retry from tenacity import stop_after_attempt from tenacity import wait_exponential