v1.3.0
Changes in changelog
This commit is contained in:
+135
-27
@@ -7,52 +7,147 @@ const config = require("../config.json")
|
||||
module.exports = () => {
|
||||
client.on("messageCreate", msg => {
|
||||
if (msg.content == config.prefix+"ticket msg"){
|
||||
if (msg.member.roles.cache.has(config.botperms_role) == false && msg.author.id != "779742674932072469"){
|
||||
msg.channel.send({content:"You don't have permissons for this command!"})
|
||||
if (msg.member.roles.cache.has(config.botperms_role) == false){
|
||||
msg.channel.send({content:config.messages.general.nopermissions})
|
||||
return
|
||||
}
|
||||
|
||||
var ticketButton = new discord.MessageActionRow()
|
||||
|
||||
const getColor = (color) => {
|
||||
if (color.toLowerCase() == "red"){
|
||||
return "DANGER"
|
||||
}else if (color.toLowerCase() == "green"){
|
||||
return "SUCCESS"
|
||||
}else if (color.toLowerCase() == "blue" || color.toLowerCase() == "blurple"){
|
||||
return "PRIMARY"
|
||||
}else if (color.toLowerCase() == "black" || color.toLowerCase() == "gray" || color.toLowerCase() == "grey"){
|
||||
return "SECONDARY"
|
||||
}else if (color == "DANGER" || color == "SECONDARY" || color == "SUCCESS" || color == "PRIMARY"){
|
||||
return color
|
||||
}else if (color.toLowerCase() == "none" || color.toLowerCase() == "false" || color.toLowerCase() == ""){
|
||||
return "SECONDARY"
|
||||
}else return "SECONDARY"
|
||||
}
|
||||
|
||||
if (config.options.ticket1.enabled){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicket1")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji(config.options.ticket1.icon)
|
||||
)
|
||||
if (config.options.ticket1.isURL == false){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicket1")
|
||||
.setDisabled(false)
|
||||
.setStyle(getColor(config.options.ticket1.color))
|
||||
.setEmoji(config.options.ticket1.icon)
|
||||
)
|
||||
}else{
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setDisabled(false)
|
||||
.setStyle("LINK")
|
||||
.setEmoji(config.options.ticket1.icon)
|
||||
.setURL(config.options.ticket1.url)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (config.options.ticket2.enabled){
|
||||
if (config.options.ticket2.isURL == false){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicket2")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setStyle(getColor(config.options.ticket2.color))
|
||||
.setEmoji(config.options.ticket2.icon)
|
||||
)
|
||||
}else{
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setDisabled(false)
|
||||
.setStyle("LINK")
|
||||
.setEmoji(config.options.ticket2.icon)
|
||||
.setURL(config.options.ticket2.url)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (config.options.ticket3.enabled){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicket3")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji(config.options.ticket3.icon)
|
||||
)
|
||||
if (config.options.ticket3.isURL == false){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicket3")
|
||||
.setDisabled(false)
|
||||
.setStyle(getColor(config.options.ticket3.color))
|
||||
.setEmoji(config.options.ticket3.icon)
|
||||
)
|
||||
}else{
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setDisabled(false)
|
||||
.setStyle("LINK")
|
||||
.setEmoji(config.options.ticket3.icon)
|
||||
.setURL(config.options.ticket3.url)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (config.options.ticket4.enabled){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicket4")
|
||||
.setDisabled(false)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji(config.options.ticket4.icon)
|
||||
)
|
||||
if (config.options.ticket4.isURL == false){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicket4")
|
||||
.setDisabled(false)
|
||||
.setStyle(getColor(config.options.ticket4.color))
|
||||
.setEmoji(config.options.ticket4.icon)
|
||||
)
|
||||
}else{
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setDisabled(false)
|
||||
.setStyle("LINK")
|
||||
.setEmoji(config.options.ticket4.icon)
|
||||
.setURL(config.options.ticket4.url)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (config.options.ticket5.enabled){
|
||||
if (config.options.ticket5.isURL == false){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicket5")
|
||||
.setDisabled(false)
|
||||
.setStyle(getColor(config.options.ticket5.color))
|
||||
.setEmoji(config.options.ticket5.icon)
|
||||
)
|
||||
}else{
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setDisabled(false)
|
||||
.setStyle("LINK")
|
||||
.setEmoji(config.options.ticket5.icon)
|
||||
.setURL(config.options.ticket5.url)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (config.options.ticket6.enabled){
|
||||
if (config.options.ticket6.isURL == false){
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setCustomId("newTicket6")
|
||||
.setDisabled(false)
|
||||
.setStyle(getColor(config.options.ticket6.color))
|
||||
.setEmoji(config.options.ticket6.icon)
|
||||
)
|
||||
}else{
|
||||
ticketButton.addComponents(
|
||||
new discord.MessageButton()
|
||||
.setDisabled(false)
|
||||
.setStyle("LINK")
|
||||
.setEmoji(config.options.ticket6.icon)
|
||||
.setURL(config.options.ticket6.url)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
var categorylist = ""
|
||||
@@ -63,13 +158,26 @@ module.exports = () => {
|
||||
if (config.options.ticket3.enabled){categorylist = categorylist+"\n\n"+config.options.ticket3.icon+": **"+config.options.ticket3.name+"**\n"+config.options.ticket3.description}
|
||||
|
||||
if (config.options.ticket4.enabled){categorylist = categorylist+"\n\n"+config.options.ticket4.icon+": **"+config.options.ticket4.name+"**\n"+config.options.ticket4.description}
|
||||
|
||||
|
||||
if (config.options.ticket5.enabled){categorylist = categorylist+"\n\n"+config.options.ticket5.icon+": **"+config.options.ticket5.name+"**\n"+config.options.ticket5.description}
|
||||
|
||||
if (config.options.ticket6.enabled){categorylist = categorylist+"\n\n"+config.options.ticket6.icon+": **"+config.options.ticket6.name+"**\n"+config.options.ticket6.description}
|
||||
|
||||
|
||||
|
||||
var ticketEmbed = new discord.MessageEmbed()
|
||||
.setColor(config.main_color)
|
||||
.setDescription("**Create a ticket:**\nClick one of the buttons below to create a ticket.\n\n__choose a category:__"+categorylist+"\n\n**watch out:**_You can only create 1 ticket at a time!_")
|
||||
if (config.layout.ticketMsg.customColorEnabled){
|
||||
ticketEmbed.setColor(config.layout.ticketMsg.customColor)
|
||||
}else{ticketEmbed.setColor(config.main_color)}
|
||||
|
||||
if (config.layout.ticketMsg.footerEnabled){
|
||||
ticketEmbed.setFooter(config.layout.ticketMsg.footer)
|
||||
}
|
||||
if (config.layout.ticketMsg.thumbnailEnabled){
|
||||
ticketEmbed.setThumbnail(config.layout.ticketMsg.thumbnailURL)
|
||||
}
|
||||
|
||||
ticketEmbed.setDescription("**Create a ticket:**\nClick one of the buttons below to create a ticket.\n\n__choose a category:__"+categorylist+"\n\n**watch out:**_You can only create "+config.system.max_allowed_tickets+" ticket(s) at a time!_")
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user