Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Discord = require('discord.js');
- var bot = new Discord.Client();
- var isReady = true;
- bot.on('message', message => {
- if (isReady && message.content === 'rottana')
- {
- isReady = false;
- var voiceChannel = message.member.voiceChannel;
- voiceChannel.join().then(connection =>
- {
- const dispatcher = connection.playFile('./pilalla.mp3');
- dispatcher.on("end", end => {
- voiceChannel.leave();
- });
- }).catch(err => console.log(err));
- isReady = true;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement