From 09d9c4d5a2355a3b05c0f8ed1a6d64bea26424c4 Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 7 Oct 2021 11:27:54 +0100 Subject: [PATCH] fix: new lines in opening message and panels --- src/commands/panel.js | 2 +- src/commands/settings.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/panel.js b/src/commands/panel.js index a791374..69f7601 100644 --- a/src/commands/panel.js +++ b/src/commands/panel.js @@ -70,7 +70,7 @@ module.exports = class PanelCommand extends Command { const categories = interaction.options.getString(default_i18n('commands.panel.options.categories.name')) .replace(/\s/g, '') .split(','); - const description = interaction.options.getString(default_i18n('commands.panel.options.description.name')); + const description = interaction.options.getString(default_i18n('commands.panel.options.description.name'))?.replace(/\\n/g, '\n'); const image = interaction.options.getString(default_i18n('commands.panel.options.image.name')); const just_type = interaction.options.getBoolean(default_i18n('commands.panel.options.just_type.name')); const title = interaction.options.getString(default_i18n('commands.panel.options.title.name')); diff --git a/src/commands/settings.js b/src/commands/settings.js index abd3025..4959b57 100644 --- a/src/commands/settings.js +++ b/src/commands/settings.js @@ -297,7 +297,7 @@ module.exports = class SettingsCommand extends Command { if (image !== null) category.set('image', image); if (name !== null) category.set('name', name); if (name_format !== null) category.set('name_format', name_format); - if (opening_message !== null) category.set('opening_message', opening_message); + if (opening_message !== null) category.set('opening_message', opening_message.replace(/\\n/g, '\n')); if (opening_questions !== null) category.set('opening_questions', JSON.parse(opening_questions)); if (ping !== null) category.set('ping', ping.replace(/\s/g, '').split(',')); if (require_topic !== null) category.set('require_topic', require_topic);