diff --git a/src/commands/new.js b/src/commands/new.js index 5e157f1..f5795c9 100644 --- a/src/commands/new.js +++ b/src/commands/new.js @@ -76,11 +76,9 @@ module.exports = { .setDescription('Please limit your ticket topic to less than 256 characters. A short sentence will do.') .setFooter(guild.name, guild.iconURL()) ); - } else if (!/("|'|`)("|'|`)/.test(config.default_topic)) { - topic = config.default_topic; } else if (topic.length < 1) { - topic = 'No topic given'; + topic = config.tickets.default_topic.command; } let ticket = await Ticket.create({ diff --git a/src/events/messageReactionAdd.js b/src/events/messageReactionAdd.js index 8418d38..707df13 100644 --- a/src/events/messageReactionAdd.js +++ b/src/events/messageReactionAdd.js @@ -89,14 +89,12 @@ module.exports = { } } - if (!/("|'|`)("|'|`)/.test(config.default_topic)) { - topic = config.default_topic; + topic = config.tickets.default_topic.panel; } else { topic = 'No topic given (created via panel)'; } - let ticket = await Ticket.create({ channel: '', creator: u.id, diff --git a/user/config.js b/user/config.js index f0cf424..0813b3a 100644 --- a/user/config.js +++ b/user/config.js @@ -47,7 +47,6 @@ module.exports = { colour: '#009999', err_colour: 'RED', cooldown: 3, - default_topic: '', guild: '', // ID of your guild (REQUIRED) staff_role: '', // ID of your Support Team role (REQUIRED) @@ -65,6 +64,10 @@ module.exports = { }, tickets: { + default_topic: { + command: 'No topic given', + panel: 'Created via panel' + }, category: '', // ID of your tickets category (REQUIRED) send_img: true, ping: 'here',