diff --git a/src/api/routes/Webhook.ts b/src/api/routes/Webhook.ts index 6827e74..d8fc994 100644 --- a/src/api/routes/Webhook.ts +++ b/src/api/routes/Webhook.ts @@ -36,8 +36,8 @@ export default class Webhook extends Route { if (!req.query?.id) return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR }); const account = await this.server.client.db.Account.findOne({ userID: req.query.id.toString() }).lean().exec(); - if (!account) return res.status(200).send({ found: false }); const moderations = await this.server.client.db.Moderation.find({ userID: req.query.id.toString() }).lean().exec(); + if (!account && (!moderations || moderations.length <= 0)) return res.status(200).send({ found: false }); const response: { found: boolean, @@ -49,9 +49,9 @@ export default class Webhook extends Route { deletes?: Date[], } = { found: true, - tier: account.tier, + tier: account?.tier || 0, totalReferrals: 0, - createdAt: account.createdAt, + createdAt: account?.createdAt || null, warns: [], locks: [], deletes: [],