Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- module.exports.run = async (client, message, args) => {
- let gAvatar = message.guild.iconURL
- message.channel.send(new Discord.RichEmbed()
- .setColor([54, 57 ,63])
- .setTitle("**Suporte - Lucs Store**")
- .setThumbnail(message.guild.userURL)
- .setFooter(`Lucs Store © Todos os direitos reservados.`)
- .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 => {
- await msg.react("❓")
- await msg.react("📋")
- await msg.react("📤")
- const collector = msg.createReactionCollector((r, u) => (r.emoji.name === "❓", "📋", "📤" && u.id === message.author.id), { time: 30000 })
- collector.on("collect", async r => {
- let title
- switch (r.emoji.name) {
- case "❓":
- title = "pedido"
- break
- case "📋":
- title = "alterações"
- break
- case "📤":
- title = "outros"
- }
- let category = message.guild.channels.find(c => c.name === "ticket")
- if (!category || category.type !== "category")
- category = await message.guild.createChannel("ticket", "category")
- let channel = await message.guild.createChannel(`ticket-${title}`, "text", [{ id: client.user.id, allowed: ["VIEW_CHANNEL", "MANAGE_CHANNELS", "READ_MESSAGE_HISTORY"]
- }, {
- id: message.author.id,
- allowed: ["VIEW_CHANNEL", "SEND_MESSAGES","READ_MESSAGE_HISTORY"]
- }, {
- id: message.guild.roles.find(c => c.name === "Equipe").id,
- allowed: ["VIEW_CHANNEL", "SEND_MESSAGES","READ_MESSAGE_HISTORY"]
- }, {
- id: message.guild.defaultRole.id,
- denied: Discord.Permissions.ALL
- }, {
- id : "600477834573512715",
- allowed: ["VIEW_CHANNEL", "SEND_MESSAGES", "READ_MESSAGE_HISTORY"]
- }])
- await channel.setParent(category.id)
- })
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement