Advertisement
Guest User

Untitled

a guest
May 25th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. var Discord = require('discord.js');
  2. var bot = new Discord.Client();
  3. var isReady = true;
  4.  
  5.  
  6. bot.on('message', message => {
  7. if (isReady && message.content === 'rottana')
  8. {
  9. isReady = false;
  10. var voiceChannel = message.member.voiceChannel;
  11. voiceChannel.join().then(connection =>
  12. {
  13. const dispatcher = connection.playFile('./pilalla.mp3');
  14. dispatcher.on("end", end => {
  15. voiceChannel.leave();
  16. });
  17. }).catch(err => console.log(err));
  18. isReady = true;
  19. }
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement