mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-05 04:13:08 +02:00
Implement placeholder for default_topic
This commit is contained in:
parent
e7d9d3558a
commit
641f13169e
@ -67,7 +67,7 @@ module.exports = {
|
||||
|
||||
|
||||
let topic = args.join(' ');
|
||||
if (topic.length > 256)
|
||||
if (topic.length > 256) {
|
||||
return message.channel.send(
|
||||
new MessageEmbed()
|
||||
.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.')
|
||||
.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({
|
||||
channel: '',
|
||||
|
@ -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({
|
||||
channel: '',
|
||||
|
@ -47,7 +47,7 @@ module.exports = {
|
||||
colour: '#009999',
|
||||
err_colour: 'RED',
|
||||
cooldown: 3,
|
||||
default_topic: 'Support Needed',
|
||||
default_topic: '',
|
||||
guild: '', // ID of your guild (REQUIRED)
|
||||
staff_role: '', // ID of your Support Team role (REQUIRED)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user