From a0a8cf6c3a0c00d093926a31763f6faa31b65cbd Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Thu, 1 Sep 2022 10:45:10 +0300 Subject: [PATCH] bugfixes --- src/structure/components/observers/GuildLogging.js | 2 +- src/utilities/SettingsMigrator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structure/components/observers/GuildLogging.js b/src/structure/components/observers/GuildLogging.js index 46d9896..ab0ad31 100644 --- a/src/structure/components/observers/GuildLogging.js +++ b/src/structure/components/observers/GuildLogging.js @@ -134,7 +134,7 @@ class GuildLogger extends Observer { const embed = { title: guild.format(`MSGLOG_THREAD_TITLE`, { action: guild.format('THREAD_SWITCH', { type }, { code: true }), channel: parent?.name || 'Missing parent' }), description: guild.format(`MSGLOG_THREAD_DESC_${type}`, { owner: owner.tag, actor: actor?.tag || 'System', name: thread.name, id: thread.id }), - footer: { text: guild.format('MSGLOG_THREAD_FOOTER', { ownerId: owner.id, channelId: parent.id, threadId: thread.id }) }, + footer: { text: guild.format('MSGLOG_THREAD_FOOTER', { ownerId: owner.id, channelId: parent?.id || 'Missing parent', threadId: thread.id }) }, color: CONSTANTS.COLORS[`THREAD_${type}`] }; diff --git a/src/utilities/SettingsMigrator.js b/src/utilities/SettingsMigrator.js index 0ad6a4e..c1c61b9 100644 --- a/src/utilities/SettingsMigrator.js +++ b/src/utilities/SettingsMigrator.js @@ -259,7 +259,7 @@ class SettingsMigrator { if (automod) { - const thresholdKeys = Object.keys(automod?.thresholds, {}); + const thresholdKeys = Object.keys(automod?.thresholds || {}); const thresholds = {}; for (const key of thresholdKeys) { thresholds[key] = { type: result.automod.thresholds[key].toUpperCase() };