fix: setting opening questions

This commit is contained in:
Isaac 2021-10-07 11:27:31 +01:00
parent 6d21838f7f
commit eb964ab85b
No known key found for this signature in database
GPG Key ID: 87B9B6BD04EB7534
2 changed files with 12 additions and 0 deletions

View File

@ -95,6 +95,12 @@ module.exports = class SettingsCommand extends Command {
required: false, required: false,
type: Command.option_types.STRING 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'), description: i18n('commands.settings.options.categories.options.edit.options.ping.description'),
name: i18n('commands.settings.options.categories.options.edit.options.ping.name'), 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 = 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 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_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 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 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')); 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 !== null) category.set('name', name);
if (name_format !== null) category.set('name_format', name_format); 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);
if (opening_questions !== null) category.set('opening_questions', JSON.parse(opening_questions));
if (ping !== null) category.set('ping', ping.replace(/\s/g, '').split(',')); if (ping !== null) category.set('ping', ping.replace(/\s/g, '').split(','));
if (require_topic !== null) category.set('require_topic', require_topic); if (require_topic !== null) category.set('require_topic', require_topic);
if (roles !== null) category.set('roles', roles.replace(/\s/g, '').split(',')); if (roles !== null) category.set('roles', roles.replace(/\s/g, '').split(','));

View File

@ -390,6 +390,10 @@
"description": "The text to send when a ticket is opened", "description": "The text to send when a ticket is opened",
"name": "opening_message" "name": "opening_message"
}, },
"opening_questions": {
"description": "Questions to ask when a ticket is opened.",
"name": "opening_questions"
},
"ping": { "ping": {
"description": "A comma-separated list of role IDs to ping", "description": "A comma-separated list of role IDs to ping",
"name": "ping" "name": "ping"