diff --git a/tasks/channel_history.py b/tasks/channel_history.py index 9d580fc..d3cbba8 100644 --- a/tasks/channel_history.py +++ b/tasks/channel_history.py @@ -93,8 +93,22 @@ class ChannelHistoryReadTask(AsyncTask): message = await MessagePyrogram._parse(self.client, message, users, chats) message = {"update_id": 1, "message": message} - data = json.dumps(message, default=JsonSerializer.default, ensure_ascii=True) - result = await self.http.post(self.webhook, data=bytes(data, "utf8")) + data = json.dumps( + message, + default=JsonSerializer.default, + ensure_ascii=True, + allow_nan=False, + check_circular=True, + sort_keys=False + ) + + result = await self.http.post( + self.webhook, + data=data, + headers=[ + ("Content-Type", "application/json") + ] + ) await result.read() result.close()