Info
Create support tickets discord.js with low effort!
Here is a list of all the npms I have created!
Useful Links
-
Go to the npm issues channel in my discord server, or contact me axiome#0441 on discord
How to use
npm i discord_ticket_maker
const Discord = require('discord.js')const client = new Discord.Client() const { DiscordTicket } = require('discord_ticket_maker')const ticket = new DiscordTicket() client.on('ready', () => { console.log(`${client.user.tag} is now online!`)}) client.on('message', async message => { if (message.content.startsWith('!t-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('!ticket')) { 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, channel, 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('TOKEN')
Values/Syntax
if you are unsure of what values to change, or do not understand, copy from the example above!
setRole(message, role)
makeTicket(message, reason, options)
closeTicket(message, channel)
msgTicketChannel(channel, args)
Category(message, ID)
editEmbed(message, args)
ticketAddUser(channel, user)
fetchChanID(message)
More values soon!