Skip to content

Instantly share code, notes, and snippets.

@appellation
Last active August 30, 2016 21:07
Show Gist options
  • Save appellation/6ad6ba2446be7e2d76873ecfc43a6a1f to your computer and use it in GitHub Desktop.
Save appellation/6ad6ba2446be7e2d76873ecfc43a6a1f to your computer and use it in GitHub Desktop.
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