Updated the guilds.ts route

This commit is contained in:
Mathias Wagner 2023-11-11 19:21:14 +01:00
parent c62594a59b
commit 82eb156712
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -11,9 +11,8 @@ app.get("/", hasRank(Rank.USER), async (req: AuthenticatedRequest, res: Response
res.json(guilds
.filter((guild) => guild.owner || (guild.permissions && (guild.permissions & 0x8)))
.map((guild) => ({id: guild.id, name: guild.name, icon: guild.icon})));
}).catch((e) => {
console.log(e)
res.status(500).json({message: "An internal error occurred"})
}).catch(() => {
res.status(500).json({message: "An internal error occurred"});
});
});