README
Djs-ticketz
Useful Links
Join the support server if you need help https://discord.gg/YjWE9bGUDF
DM me on discord at Aidan The Sister#0001
How to use
npm install discordjs-tickets
const Discord = require('discord.js')
const client = new Discord.Client()
const { Ticket } = require('discordjs-tickets')
const ticket = new Ticket()
client.on('ready', () => {
console.log(`${client.user.tag} is now online!`)
})
client.on('message', async message => {
if (message.content.startsWith('?role')) {
const role = message.mentions.roles.first()
ticket.setRole(message, role) //Set the support role, that gets pinged when a new ticket is created!
}
if (message.content.startsWith('?rmvrole')) {
const role = message.mentions.roles.first()
ticket.rmvRole(message, role) //Removes the specified role from the pings list when a new ticket is made!
}
if (message.content.startsWith('?new')) {
const reason = message.content.slice(7)
ticket.makeTicket(message, reason, "swrf")//Creates a new ticket, the reason is optional!
}
if (message.content.startsWith('?close')) {
const args = message.content.slice(6)
const channel = message.mentions.channels.first() || message.guild.channels.cache.find(c => c.id == args || c.name == args) || message.channel
ticket.closeTicket(message, channel)
}
if (message.content.startsWith('?send')) {
const channel = message.mentions.channels.first()
const args = message.content.slice(5)
ticket.msgTicketChannel(message, category, args)//fixes coming soon, for this command
}
if (message.content.startsWith('?category')) {
const ID = message.content.slice(9)//must be the category id
ticket.Category(message, ID)
message.channel.send(`Ticket Category has been set!`)
}
if (message.content.startsWith('?embed-message')) {
const args = message.content.slice(14)
ticket.editEmbed(message, args)
}
if(message.content.startsWith(`!add-user`)) {
const channel = message.mentions.channels.first()
const user = message.mentions.users.first()
ticket.ticketAddUser(channel, user)
}
if (message.content === `?id`) {
const ID = await ticket.fetchChanID(message)
message.channel.send(`This channels id is ${ID}`)
}
})
client.login('Your Token Here')