Zaayd

Private Channel System (Command 1/2) -Setup Category-

Jul 5th, 2021 (edited)
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. const db = require("quick.db");
  3. let prefix = "+";
  4. exports.run = async (client, message, prefix) =>  {
  5.   if (message.author.bot || message.channel.type == "dm") return undefined;
  6.     if (!message.member.hasPermission("ADMINISTRATOR")) return;
  7.   let args = message.content.split(" ");
  8.   if(!args[1]) return message.channel.send(`**${prefix}setPrivate-category [CATEGORY ID]**`)
  9.   let find = message.guild.channels.cache.find(ch => ch.id === args[1]);
  10.   if(!find) return message.channel.send("**Invalid Channel**")
  11.   let channelCategory = find;
  12.   if(channelCategory.type != "category") return message.channel.send(`**Invalid Channel Type : Supported Type \`category\`**`)
  13.   await db.set(`PrivateCategory_[${message.guild.id}]`,channelCategory.id)
  14.   message.channel.send(`**Voice Channel Is : \`${channelCategory.name}\`**`)
  15. };
  16.  
  17. exports.conf = {
  18.     enabled: true,
  19.     aliases: ["setprivate-category"],
  20. };
  21.  
  22. exports.help = {
  23.     name: 'setprivate-category',
  24.     description: '',
  25.     usage: ''
  26. };
  27.  
  28. /*
  29. Code by Me , 9 9 9 </>#9044
  30. Me Codes Link : https://discord.gg/td3NFBBkGC or https://discord.gg/mecodes
  31. */
  32. /*
  33. Other Link :
  34. Private Channel (Event) : https://pastebin.com/E1VAjLF5
  35. Setup Channel : https://pastebin.com/T4x5uZk8
  36. */
Add Comment
Please, Sign In to add comment