Advertisement
Zaayd

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

Jul 5th, 2021
1,177
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-channel [CHANNEL 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 channelVoice = find;
  12.   if(channelVoice.type != "voice") return message.channel.send(`**Invalid Channel Type : Supported Type \`voice\`**`)
  13.   await db.set(`PrivateCahnnel_[${message.guild.id}]`,channelVoice.id)
  14.   message.channel.send(`**Voice Channel Is : <#${channelVoice.id}>**`)
  15. };
  16.  
  17. exports.conf = {
  18.     enabled: true,
  19.     aliases: ["setprivate-channel"],
  20. };
  21.  
  22. exports.help = {
  23.     name: 'setprivate-channel',
  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 Category : https://pastebin.com/JVg29hvZ
  36. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement