Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on('message', async message => {
- if (message.content.toLowerCase().startsWith(prefix + `ticket`)) {
- if(client.guilds.get('507999713962754048').channels.find(ch => ch.name === 'ticket-') + channel.author.id) {
- let embed_deny = new Discord.RichEmbed()
- .setTitle("Ticket creation canceled:")
- .setDescription(`<@${message.author.id}>, You can't create more then 1 ticket.`/n`if you need support you can reply to your exist ticket.`)
- .setColor("#bf132d")
- .setFooter(`${message.author.tag} • ${message.author.id}`)
- var log_channel = client.guilds.get('507999713962754048').channels.find(ch => ch.name === 'ticket-logs')
- channel.message.send(embed_deny)
- // message.react('❌');
- log_channel.message.send(embed_deny)
- // log_msg.setTimestamp(wel_msg.createdAt)
- }
- else {
- message.guild.createChannel(`ticket~${message.author.id}`, {
- type: 'text', // Set the type of the channel
- topic: `Owner: <@${message.author.id}> (${message.author.id}) • Created in: <#${message.channel.id}> • Created by: <@263181099058987009>` , // Set the description
- parent: '615060222469341186', // Set the parent of a channel
- permissionOverwrites: [{
- id: message.author.id,
- deny: ['MANAGE_MESSAGES'],
- allow: ['SEND_MESSAGES'],
- allow: ['READ_MESSAGES']
- }]
- })
- let embeds = new Discord.RichEmbed()
- var ticketcnl = client.guilds.get('507999713962754048').channels.find(ch => ch.name === `ticket-${message.author.id}`)
- .setTitle("Ticket Information:")
- .setDescription(`<@${message.author.id}>, Your ticket has been created successfully.`)
- .setDescription(`The channel created in: ` + ticketcnl)
- .setColor("#4287f5")
- .setFooter(`This message will be deleted in 10 seconds • ${message.author.id}`)
- channel.message.send(embeds);
- // message.react('✅');
- let fmsg = new Discord.RichEmbed()
- .setTitle("New ticket:")
- .setDescription(`<@${message.author.id}>, Thank you for contact our support team, We will response as soon as possible.`)
- .addField(`Subject:`, `none`)
- // .setFooter(`Please be patient, our staff team will response as soon as possible • (${message.author.id})`)
- var ticket_chnl = client.guilds.get('507999713962754048').channels.find(ch => ch.name === `ticket-${message.author.id}`)
- await ticket_chnl.send(fmsg)
- //fmsg.setTimestamp(wel_msg.createdAt)
- ticketcnl.message.send(`<@&508726400623181846>`)
- // ticket~${message.author.tag}
- let log_msg = new Discord.RichEmbed()
- .setTitle("Ticket Logs:")
- .setDescription(`<@${message.author.id}> Has just created a ticket.`)
- .addField(`Cerated in:`, `<#${message.channel.id}>`)
- .setColor("#bf132d")
- .setFooter(`${message.author.tag} • ${message.author.id}`)
- //log_msg.setTimestamp(wel_msg.createdAt)
- var channel = client.guilds.get('507999713962754048').channels.find(ch => ch.name === 'ticket-logs')
- message.channel.send(log_msg)
- // message.react('✅');
- } // end of else
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement