Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. client.on('message', async message => {
  2. if (message.content.toLowerCase().startsWith(prefix + `ticket`)) {
  3.  
  4. if(client.guilds.get('507999713962754048').channels.find(ch => ch.name === 'ticket-') + channel.author.id) {
  5.  
  6. let embed_deny = new Discord.RichEmbed()
  7. .setTitle("Ticket creation canceled:")
  8. .setDescription(`<@${message.author.id}>, You can't create more then 1 ticket.`/n`if you need support you can reply to your exist ticket.`)
  9. .setColor("#bf132d")
  10. .setFooter(`${message.author.tag} • ${message.author.id}`)
  11. var log_channel = client.guilds.get('507999713962754048').channels.find(ch => ch.name === 'ticket-logs')
  12. channel.message.send(embed_deny)
  13. // message.react('❌');
  14. log_channel.message.send(embed_deny)
  15. // log_msg.setTimestamp(wel_msg.createdAt)
  16.  
  17. }
  18.  
  19. else {
  20. message.guild.createChannel(`ticket~${message.author.id}`, {
  21. type: 'text', // Set the type of the channel
  22. topic: `Owner: <@${message.author.id}> (${message.author.id}) • Created in: <#${message.channel.id}> • Created by: <@263181099058987009>` , // Set the description
  23. parent: '615060222469341186', // Set the parent of a channel
  24.  
  25. permissionOverwrites: [{
  26. id: message.author.id,
  27. deny: ['MANAGE_MESSAGES'],
  28. allow: ['SEND_MESSAGES'],
  29. allow: ['READ_MESSAGES']
  30. }]
  31.  
  32. })
  33.  
  34. let embeds = new Discord.RichEmbed()
  35. var ticketcnl = client.guilds.get('507999713962754048').channels.find(ch => ch.name === `ticket-${message.author.id}`)
  36. .setTitle("Ticket Information:")
  37. .setDescription(`<@${message.author.id}>, Your ticket has been created successfully.`)
  38. .setDescription(`The channel created in: ` + ticketcnl)
  39. .setColor("#4287f5")
  40. .setFooter(`This message will be deleted in 10 seconds • ${message.author.id}`)
  41. channel.message.send(embeds);
  42. // message.react('✅');
  43.  
  44.  
  45.  
  46. let fmsg = new Discord.RichEmbed()
  47. .setTitle("New ticket:")
  48. .setDescription(`<@${message.author.id}>, Thank you for contact our support team, We will response as soon as possible.`)
  49. .addField(`Subject:`, `none`)
  50. // .setFooter(`Please be patient, our staff team will response as soon as possible • (${message.author.id})`)
  51. var ticket_chnl = client.guilds.get('507999713962754048').channels.find(ch => ch.name === `ticket-${message.author.id}`)
  52. await ticket_chnl.send(fmsg)
  53. //fmsg.setTimestamp(wel_msg.createdAt)
  54. ticketcnl.message.send(`<@&508726400623181846>`)
  55.  
  56.  
  57.  
  58.  
  59.  
  60. // ticket~${message.author.tag}
  61. let log_msg = new Discord.RichEmbed()
  62. .setTitle("Ticket Logs:")
  63. .setDescription(`<@${message.author.id}> Has just created a ticket.`)
  64. .addField(`Cerated in:`, `<#${message.channel.id}>`)
  65. .setColor("#bf132d")
  66. .setFooter(`${message.author.tag} • ${message.author.id}`)
  67. //log_msg.setTimestamp(wel_msg.createdAt)
  68.  
  69. var channel = client.guilds.get('507999713962754048').channels.find(ch => ch.name === 'ticket-logs')
  70. message.channel.send(log_msg)
  71. // message.react('✅');
  72.  
  73.  
  74. } // end of else
  75. }
  76. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement