Last active
August 30, 2016 21:07
-
-
Save appellation/6ad6ba2446be7e2d76873ecfc43a6a1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chaine = msg.content.split(" "); | |
// Also, consider using `msg.author.voiceChannel` | |
bot.joinVoiceChannel(bot.channels.get("name", "Général")).then(function(vc){ | |
var request = require("request"); | |
var url = chaine[1]; | |
var stream = request(url); | |
return vc.playRawStream(stream); | |
}).then(intent => { | |
bot.reply(msg, "playing!").then((msg) => { | |
intent.on("end", () => { | |
bot.updateMessage(msg, "that song has finished now."); | |
}); | |
}); | |
}).catch(function(error){ | |
console.log(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment