summary refs log tree commit diff
path: root/api/src
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-02-04 23:43:31 +0300
committerGitHub <noreply@github.com>2022-02-04 23:43:31 +0300
commit340c0d7899725a733932a6f89aec8b7e16521cc2 (patch)
tree3abfaf6d1d9345065d660b0db2de1161ea2623b6 /api/src
parentpretend self-bans don't exist in the views too (diff)
parentBump simple-get from 3.1.0 to 3.1.1 in /util (#620) (diff)
downloadserver-340c0d7899725a733932a6f89aec8b7e16521cc2.tar.xz
Merge branch 'master' into origin/dev/erkinalp/self-bans
Diffstat (limited to 'api/src')
-rw-r--r--api/src/routes/channels/#channel_id/messages/index.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/api/src/routes/channels/#channel_id/messages/index.ts b/api/src/routes/channels/#channel_id/messages/index.ts

index 1ae9d676..5fdab623 100644 --- a/api/src/routes/channels/#channel_id/messages/index.ts +++ b/api/src/routes/channels/#channel_id/messages/index.ts
@@ -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; }) );