From eb964ab85bae927eb980ae1a452e3dfa3473a012 Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 7 Oct 2021 11:27:31 +0100 Subject: [PATCH] fix: setting opening questions --- src/commands/settings.js | 8 ++++++++ src/locales/en-GB.json | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/commands/settings.js b/src/commands/settings.js index 17d3170..abd3025 100644 --- a/src/commands/settings.js +++ b/src/commands/settings.js @@ -95,6 +95,12 @@ module.exports = class SettingsCommand extends Command { required: false, type: Command.option_types.STRING }, + { + description: i18n('commands.settings.options.categories.options.edit.options.opening_questions.description'), + name: i18n('commands.settings.options.categories.options.edit.options.opening_questions.name'), + required: false, + type: Command.option_types.STRING + }, { description: i18n('commands.settings.options.categories.options.edit.options.ping.description'), name: i18n('commands.settings.options.categories.options.edit.options.ping.name'), @@ -281,6 +287,7 @@ module.exports = class SettingsCommand extends Command { const name = interaction.options.getString(default_i18n('commands.settings.options.categories.options.edit.options.name.name')); const name_format = interaction.options.getString(default_i18n('commands.settings.options.categories.options.edit.options.name_format.name')); const opening_message = interaction.options.getString(default_i18n('commands.settings.options.categories.options.edit.options.opening_message.name')); + const opening_questions = interaction.options.getString(default_i18n('commands.settings.options.categories.options.edit.options.opening_questions.name')); const ping = interaction.options.getString(default_i18n('commands.settings.options.categories.options.edit.options.ping.name')); const require_topic = interaction.options.getBoolean(default_i18n('commands.settings.options.categories.options.edit.options.require_topic.name')); const roles = interaction.options.getString(default_i18n('commands.settings.options.categories.options.edit.options.roles.name')); @@ -291,6 +298,7 @@ module.exports = class SettingsCommand extends Command { 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_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); if (roles !== null) category.set('roles', roles.replace(/\s/g, '').split(',')); diff --git a/src/locales/en-GB.json b/src/locales/en-GB.json index a22fc0b..7b65742 100644 --- a/src/locales/en-GB.json +++ b/src/locales/en-GB.json @@ -390,6 +390,10 @@ "description": "The text to send when a ticket is opened", "name": "opening_message" }, + "opening_questions": { + "description": "Questions to ask when a ticket is opened.", + "name": "opening_questions" + }, "ping": { "description": "A comma-separated list of role IDs to ping", "name": "ping"