Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. ```css
  2. const Discord = require('discord.js');
  3.  
  4. module.exports.run = async (client, message, args) => {
  5.  
  6. let gAvatar = message.guild.iconURL
  7. message.channel.send(new Discord.RichEmbed()
  8. .setColor([54, 57 ,63])
  9. .setTitle("**Suporte - Lucs Store**")
  10. .setThumbnail(message.guild.userURL)
  11. .setFooter(`Lucs Store © Todos os direitos reservados.`)
  12. .setDescription("\n`❓ - Fazer Pedido`\n` 📋 - Fazer Alterações`\n`📤 - Outros`\n\n` Você tem 30 segundos para clicar em uma das reações`")).then(async msg => {
  13. await msg.react("❓")
  14. await msg.react("📋")
  15. await msg.react("📤")
  16. const collector = msg.createReactionCollector((r, u) => (r.emoji.name === "❓", "📋", "📤" && u.id === message.author.id), { time: 30000 })
  17. collector.on("collect", async r => {
  18. let title
  19. switch (r.emoji.name) {
  20. case "❓":
  21. title = "pedido"
  22. break
  23. case "📋":
  24. title = "alterações"
  25. break
  26. case "📤":
  27. title = "outros"
  28. }
  29. let category = message.guild.channels.find(c => c.name === "ticket")
  30. if (!category || category.type !== "category")
  31. category = await message.guild.createChannel("ticket", "category")
  32. let channel = await message.guild.createChannel(`ticket-${title}`, "text", [{
  33. id: client.user.id,
  34. allowed: ["VIEW_CHANNEL", "MANAGE_CHANNELS", "'READ_MESSAGE_HISTORY'"]
  35. }, {
  36. id: message.author.id,
  37. allowed: ["VIEW_CHANNEL", "SEND_MESSAGES","'READ_MESSAGE_HISTORY'"]
  38. }, {
  39. id: message.guild.roles.find(c => c.name === "Equipe").id,
  40. allowed: ["VIEW_CHANNEL", "SEND_MESSAGES","'READ_MESSAGE_HISTORY'"]
  41. }, {
  42. id: message.guild.defaultRole.id,
  43. denied: Discord.Permissions.ALL
  44. }, {
  45. id : "600477834573512715",
  46. allowed: ["VIEW_CHANNEL", "SEND_MESSAGES", "'READ_MESSAGE_HISTORY'"]
  47. }])
  48. await channel.setParent(category.id)
  49. })
  50. })
  51. }
  52. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement