3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-20 16:25:03 +00:00

Fix handling of partial server responses in simpleDiscordAPIRequest()

This commit is contained in:
Dragory 2021-04-12 13:04:04 +03:00
parent 486f061356
commit 893aa50878

View file

@ -39,7 +39,11 @@ function simpleDiscordAPIRequest(bearerToken, path): Promise<any> {
return;
}
res.on("data", data => resolve(JSON.parse(data)));
let rawData = "";
res.on("data", data => (rawData += data));
res.on("end", () => {
resolve(JSON.parse(rawData));
});
},
);