Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
70
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: 'music',
  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.voiceConnection)
  20. {
  21. message.member.voiceChannel.join()
  22. .then(connection =>{
  23. message.reply("Successfully Joined!");
  24. })
  25. }
  26. }
  27. else
  28. {
  29. message.reply("You must be in a voice channel to summon me!");
  30. }
  31. }
  32. }
  33.  
  34. module.exports = JoinChannelCommand;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement