1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-06 10:52:31 +01:00

Merge pull request #616 from MaddyUnderStars/noNullsInMessageFetch

Improve compatibly with some clients ( discord.js )
This commit is contained in:
Erkin Alp Güney 2022-02-04 12:07:52 +03:00 committed by GitHub
commit 706a59f44d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,6 +126,13 @@ router.get("/", async (req: Request, res: Response) => {
y.proxy_url = `${endpoint == null ? "" : endpoint}${new URL(uri).pathname}`;
});
//Some clients ( discord.js ) only check if a property exists within the response,
//which causes erorrs when, say, the `application` property is `null`.
for (var curr in x) {
if (x[curr] === null)
delete x[curr];
}
return x;
})
);