From 92764fabc6bd8f94fa062e7ee8f1c96cdf35af5b Mon Sep 17 00:00:00 2001 From: Evorp <3vorpgaming@gmail.com> Date: Sun, 22 Oct 2023 19:40:00 -0700 Subject: [PATCH] [object Object] fix (this has been an issue for ages) --- src/v2/service/addon.service.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/v2/service/addon.service.ts b/src/v2/service/addon.service.ts index 7eb0a74..01a33bf 100644 --- a/src/v2/service/addon.service.ts +++ b/src/v2/service/addon.service.ts @@ -601,14 +601,13 @@ export default class AddonService { const url = `https://webapp.faithfulpack.net/#/review/addons?status=${now}&id=${String(a.id)}`; if (now === "pending") { title = `Add-on '${a.name}' pending approval`; - name += "update"; + name += "Update"; } else { - const usernameApproval = - (a.approval.author - ? await this.userService.getUserById(a.approval.author).catch(() => undefined) - : undefined) || "someone"; - title = `Add-on '${a.name}' ${now} by ${usernameApproval}`; - name += "review"; + const usernameApproval = (a.approval.author + ? await this.userService.getUserById(a.approval.author).catch(() => undefined) + : undefined) || { username: "an unknown user" }; + title = `Add-on '${a.name}' ${now} by ${usernameApproval.username}!`; + name += "Review"; } const payload: RESTPostAPIChannelMessageJSONBody = { embeds: [ @@ -626,7 +625,6 @@ export default class AddonService { }, }, ], - content: "", }; await axios.post(process.env.WEBHOOK_URL, payload);