Update index.ts

This commit is contained in:
Intevel ツ 2021-05-08 16:48:32 +02:00
parent 0dca4700fb
commit f9e66f6d1d

View File

@ -88,9 +88,9 @@ router.get("/vanity-url", async (req: Request, res: Response) => {
const guild = await GuildModel.findOne({ id: guild_id }).exec();
if (!guild) throw new HTTPError("Guild does not exist", 404);
if(!guild.vanity_url_code) throw new HTTPError("This guild has no vanity url", 204)
if(!guild.vanity_url) throw new HTTPError("This guild has no vanity url", 204)
return res.json(guild.vanity_url_code);
return res.json(toObject(guild.vanity_url));
});
export default router;