easy-tickets
v1.0.6
Published
easy package for discord.js at any version
Downloads
4
Maintainers
Readme
Easy package to create tickets!
Quick Example
const Discord = require('discord.js')
const discord = require('discord.js')
const { Intents, Collection, MessageEmbed, MessageAttachment, MessageButton, MessageActionRow, APIMessage } = require('discord.js')
const intents = new Intents()
intents.add(
'GUILD_MEMBERS',
'GUILDS',
'GUILD_BANS',
'GUILD_VOICE_STATES',
'GUILD_EMOJIS_AND_STICKERS',
'GUILD_MESSAGES',
'GUILD_MESSAGE_REACTIONS'
)
const client = new Discord.Client({ intents: intents});
const manager = require('easy-tickets')
client.on("ready", () => console.log("ready"))
client.on("messageCreate", async message => {
if(message.content === 'create-ticket'){
manager.setTicketChannel(message.guild.channels.cache.get("012345678901234567"), {
embed: {
title: "Ticket System",
thumbnail: null,
description: "Click on the button bellow to create a ticket!",
color: 'BLACK',
footer: "Developer: KANOX#1323",
timestamp: true
},
button: {
label: 'click here',
emoji: '🔓',
id: "openticket",
style: "SECONDARY"
}
})
}
})
client.on("interactionCreate", async (interaction) => {
if(interaction.customId === 'openticket'){
const role1 = interaction.guild.roles.cache.get("882640050712641616")
manager.createTicket(interaction.guild, interaction.guild.channels.cache.get("898950622110437426"), {
embed: {
title: "Ticket Created",
thumbnail: null,
description: "Click on the button bellow to delete the ticket!",
color: 'BLACK',
footer: "Developer: KANOX#1323",
timestamp: true
},
button: {
label: "Delete",
emoji: '🔒',
id: "closeticket",
style: "DANGER"
}
})
}else if(interaction.customId === 'closeticket'){
manager.deleteTicket(interaction.channel)
}
})
client.login("TOKEN")