Implement placeholder for default_topic

This commit is contained in:
o5pxels 2020-12-20 20:14:35 -06:00
parent e7d9d3558a
commit 641f13169e
3 changed files with 15 additions and 4 deletions

View File

@ -67,7 +67,7 @@ module.exports = {
let topic = args.join(' '); let topic = args.join(' ');
if (topic.length > 256) if (topic.length > 256) {
return message.channel.send( return message.channel.send(
new MessageEmbed() new MessageEmbed()
.setColor(config.err_colour) .setColor(config.err_colour)
@ -76,7 +76,12 @@ module.exports = {
.setDescription('Please limit your ticket topic to less than 256 characters. A short sentence will do.') .setDescription('Please limit your ticket topic to less than 256 characters. A short sentence will do.')
.setFooter(guild.name, guild.iconURL()) .setFooter(guild.name, guild.iconURL())
); );
else if (topic.length < 1) topic = config.default_topic; } else if (/^[a-zA-Z0-9]+$/.test(config.default_topic)) {
topic = config.default_topic;
}
else if (topic.length < 1) {
topic = 'No topic given';
}
let ticket = await Ticket.create({ let ticket = await Ticket.create({
channel: '', channel: '',

View File

@ -89,7 +89,13 @@ module.exports = {
} }
} }
let topic = config.default_topic;
if (/^[a-zA-Z0-9]+$/.test(config.default_topic)) {
topic = config.default_topic;
} else {
topic = 'No topic given (created via panel)';
}
let ticket = await Ticket.create({ let ticket = await Ticket.create({
channel: '', channel: '',

View File

@ -47,7 +47,7 @@ module.exports = {
colour: '#009999', colour: '#009999',
err_colour: 'RED', err_colour: 'RED',
cooldown: 3, cooldown: 3,
default_topic: 'Support Needed', default_topic: '',
guild: '', // ID of your guild (REQUIRED) guild: '', // ID of your guild (REQUIRED)
staff_role: '', // ID of your Support Team role (REQUIRED) staff_role: '', // ID of your Support Team role (REQUIRED)