Advertisement
Guest User

Code

a guest
Aug 21st, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const commando = require('discord.js-commando');
  2.  
  3. class JoinChannelCommand extends commando.Command
  4. {
  5.     constructor(client)
  6.     {
  7.         super(client,{
  8.             name: 'join',
  9.             group: 'General',
  10.             memberName: 'join',
  11.             description: 'joins the voice channel of the commander'
  12.         });
  13.     }
  14.  
  15.     async run(message, args)
  16.     {
  17.         if(message.member.voiceChannel)
  18.         {
  19.             if(!message.guild.voiceConnectionLive)
  20.             {
  21.                 message.member.voiceChannel.join()
  22.                     .then(connection =>{
  23.                         message.reply("Zzz");
  24.                     })
  25.             }
  26.         }
  27.         else    
  28.         {
  29.             message.reply("(You must be a channel to summon me)");
  30.         }
  31.     }
  32. }
  33.  
  34. module.exports = JoinChannelCommand;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement