Hey all! Today I'm excited to announce that we're launching a highly requested feature into beta: support for Discord music bots!
We've prepared an example Discord music app that you can have up and running in your server immediately. It supports basic queueing and search, but it's made to be extended and improved. Use it as an example of how to build around voice!
Discord Voice APIs
We've added a new discord/voice API that you can use to programmatically control playback. For example, the following API call:
let currentTrack = await lib.discord.voice['@0.0.1'].tracks.retrieve({
guild_id: `${context.params.event.guild_id}`
});
Will return data on what your bot is currently playing in your server. We recommend checking out the source code for the example Discord music app for more examples on how to use these APIs!
Discord bot.playback.finished Event
We've also added support for a new Discord event, bot.playback.finished
, that fires when your bot finishes playing a track. This allows for continuous playback — you could use it to start playing another song when one finishes.
Thank You!
We hope you enjoy playing music in your server! If you haven't already, please join our Discord community if you have questions, want to hang out with other Autocode builders, or to hear a music bot in action! You can also follow us on Twitter @Autocode to stay up to date with Autocode news.
Jacob Lee
Co-Founder, Autocode