Advertisement
2wild4u

ticketclose.js

Mar 27th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. const footer = "Master [Code-Docs]";
  3. module.exports.run = async (bot, message, args) => {
  4.     // Id van category van tickets.
  5.     const categoryId = "691192396276432946";
  6.  
  7.     // Als bericht in ticket kanaal is dan verwijder kanaal ander zend bericht
  8.     if (message.channel.parentID == categoryId) {
  9.  
  10.         message.channel.delete();
  11.  
  12.     } else {
  13.  
  14.         message.channel.send("Use the command in 🔖 TICKETS MESSAGE Category");
  15.  
  16.     }
  17.     let Sender = message.author;
  18.     const closemsg = args.slice(0).join(" ");
  19.     if(!closemsg) return message.channel.send(":x: " + "`| Please mention the issues in your ticket, more info we got that way we can find the best solution for you Usage: </>ticket <message>`").then(msg => msg.delete(5000))
  20.     message.delete();
  21.     var embedCloseTicket = new Discord.MessageEmbed()
  22.         .setColor("#1f264d")
  23.         .setAuthor('Master [Code-Docs] Ticket Message!', 'https://thumbs.gfycat.com/DeliciousJoyfulAustralianshelduck-max-1mb.gif')
  24.         .addField("Ticket sent by", Sender, true)
  25.         .addField("Ticket: ", args)
  26.         .setFooter("Ticket Completed & Closed")
  27.         .setTimestamp();
  28.  
  29.     // Vind kanaal voor de logs.
  30.     var logChannel = message.guild.channels.cache.find(x => x.name === "🔖◦tickets")
  31.     //var logChannel = message.guild.channels.cache.find("name", "🔖◦tickets");
  32.     if (!logChannel) return message.channel.send("Channel don\'t exsist");
  33.  
  34.     logChannel.send(embedCloseTicket);
  35.  
  36. }
  37.  
  38. module.exports.config = {
  39.     name: "ticket-close-2",
  40.     aliases: ["close"],
  41.     description: "Close The Ticket"
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement