{"id":21430066,"url":"https://github.com/luuk-dev/discordaudio","last_synced_at":"2025-07-14T11:31:03.872Z","repository":{"id":44662948,"uuid":"419840483","full_name":"Luuk-Dev/DiscordAudio","owner":"Luuk-Dev","description":"Create easily a Discord music bot with this package.","archived":false,"fork":false,"pushed_at":"2024-08-06T19:26:22.000Z","size":266,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-23T19:37:08.394Z","etag":null,"topics":["audio","bot","discord","discord-bot","discord-js","music","stream","voice","voicechannel"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Luuk-Dev.png","metadata":{"files":{"readme":"readme.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-21T18:47:06.000Z","updated_at":"2024-08-06T19:26:26.000Z","dependencies_parsed_at":"2024-04-09T22:47:56.441Z","dependency_job_id":"4c0b7c74-59c8-480a-9d46-14ac91cb6e38","html_url":"https://github.com/Luuk-Dev/DiscordAudio","commit_stats":{"total_commits":108,"total_committers":2,"mean_commits":54.0,"dds":0.0092592592592593,"last_synced_commit":"2bd42ca458639125b8052014bd8c6bc967b55008"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luuk-Dev%2FDiscordAudio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luuk-Dev%2FDiscordAudio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luuk-Dev%2FDiscordAudio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luuk-Dev%2FDiscordAudio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Luuk-Dev","download_url":"https://codeload.github.com/Luuk-Dev/DiscordAudio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225972007,"owners_count":17553574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","bot","discord","discord-bot","discord-js","music","stream","voice","voicechannel"],"created_at":"2024-11-22T22:20:30.032Z","updated_at":"2024-11-22T22:20:30.639Z","avatar_url":"https://github.com/Luuk-Dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Audio\r\n[![downloadsBadge](https://img.shields.io/npm/dt/discordaudio?style=for-the-badge)](https://npmjs.com/package/discordaudio)\r\n[![versionBadge](https://img.shields.io/npm/v/discordaudio?style=for-the-badge)](https://npmjs.com/package/discordaudio)\r\n[![documentationBadge](https://img.shields.io/badge/Documentation-Click%20here-blue?style=for-the-badge)](https://discord-audio.weijers1.com/)\r\n\r\n## 🔧 Installation\r\nInstall [Discord Audio](https://npmjs.com/package/discordaudio)\r\n```\r\n$ npm install discordaudio@latest\r\n```\r\n```\r\n$ yarn add discordaudio@latest\r\n```\r\n\r\n## ℹ️ About\r\nDiscord Audio is a stable and easy to use discord voice channel framework which is compatible with multiple Discord.js versions. Discord Audio makes you able to play your favorite songs in a voice channel with your Discord bot.\r\n\r\n## 🔑 Features\r\n* [AudioManager](https://discord-audio.weijers1.com/classes/audiomanager) - Create a music bot if you are a developer with not many experience\r\n* [Player](https://discord-audio.weijers1.com/classes/player) - Create a music bot if you are a developer with experience\r\n* [Connection](https://discord-audio.weijers1.com/classes/connection) - Create a bot that plays a stream that never ends\r\n* [Broadcast](https://discord-audio.weijers1.com/classes/broadcast) - Create a broadcast to play in multiple servers\r\n* [Adapter](https://discord-audio.weijers1.com/classes/adapter) - Create an adapter to play a song in a voice channel if you are not using Discord Audio\r\n\r\n## 🔗 Links\r\n* [Full documentation](https://discord-audio.weijers1.com/)\r\n* [Support Server](https://www.weijers1.com/discord)\r\n\r\n## 📖 Example\r\n```js\r\nconst { AudioManager } = require('discordaudio');\r\nconst discord = require('discord.js');\r\n\r\nconst client = new discord.Client({intents: [discord.GatewayIntentBits.FLAGS.GUILDS, discord.GatewayIntentBits.FLAGS.GUILD_MESSAGES, discord.GatewayIntentBits.FLAGS.GUILD_VOICE_STATES]});\r\n\r\nconst config = {\r\n    token: 'Your-Secret-Token',\r\n    prefix: '-'\r\n};\r\n\r\nconst connections = new Map();\r\n\r\nconst audioManager = new AudioManager();\r\n\r\nclient.once('ready', () =\u003e console.log(`${client.user.username} is online!`));\r\n\r\nclient.on('messageCreate', message =\u003e {\r\n    if(message.author.bot || message.channel.type === `DM`) return;\r\n    \r\n    if(!message.content.startsWith(config.prefix)) return;\r\n    \r\n    let args = message.content.substring(config.prefix.length).split(\" \");\r\n    \r\n    const vc = connections.get(message.guild,members.me.voice.channel?.id);\r\n    \r\n    switch(args[0].toLowerCase()){\r\n        case 'play':\r\n            if(!message.member.voice.channel \u0026\u0026 !message.guild.members.me.voice.channel) return message.channel.send({content: `Please join a voice channel in order to play a song!`});\r\n            if(!args[1]) return message.channel.send({content: `Please provide a song`});\r\n            const uvc = message.member.voice.channel || message.guild.members.me.voice.channel;\r\n            audioManager.play(uvc, args[1], {\r\n                quality: 'high',\r\n                audiotype: 'arbitrary',\r\n                volume: 10\r\n            }).then(queue =\u003e {\r\n                connections.set(uvc.id, uvc);\r\n                if(queue === false) message.channel.send({content: `Your song is now playing!`});\r\n                else message.channel.send({content: `Your song has been added to the queue!`});\r\n            }).catch(err =\u003e {\r\n                console.log(err);\r\n                message.channel.send({content: `There was an error while trying to connect to the voice channel!`});\r\n            });\r\n            break;\r\n        case 'skip':\r\n            if(!vc) return message.channel.send({content: `There is currently nothing playing!`});\r\n            audioManager.skip(vc).then(() =\u003e message.channel.send({content: `Successfully skipped the song!`})).catch(err =\u003e {\r\n                console.log(err);\r\n                message.channel.send({content: `There was an error while skipping the song!`});\r\n            });\r\n            break;\r\n        case 'stop':\r\n            if(!vc) return message.channel.send({content: `There is currently nothing playing!`});\r\n            audioManager.stop(vc);\r\n            message.channel.send({content: `Player successfully stopped!`});            \r\n            break;\r\n        case 'queue':\r\n            if(!vc) return message.channel.send({content: `There is currently nothing playing!`});\r\n            const queue = audioManager.queue(vc).reduce((text, song, index) =\u003e {\r\n                if(index \u003e 50){\r\n                    return text;\r\n                } else if(index \u003e 49){\r\n                    text += `\\n...`;\r\n                    return text;\r\n                }\r\n                if(song.title) text += `\\n**[${index + 1}]** ${song.title}`;\r\n                else text += `\\n**[${index + 1}]** ${song.url}`;\r\n                return text;\r\n            }, `__**QUEUE**__`);\r\n            const queueEmbed = new discord.EmbedBuilder()\r\n            .setColor(`Blurple`)\r\n            .setTitle(`Queue`)\r\n            .setDescription(queue);\r\n            message.channel.send({embeds: [queueEmbed]});\r\n            break;\r\n        case 'volume':\r\n            if(!vc) return message.channel.send({content: `There is currently nothing playing!`});\r\n            if(!args[1]) return message.channel.send({content: `Please provide the volume`});\r\n            if(Number(args[1]) \u003c 1 || Number(args[1]) \u003e 10) return message.channel.send({content: `Please provide a volume between 1-10`});\r\n            audioManager.volume(vc, Number(args[1]));\r\n            break;\r\n        case 'shuffle':\r\n            if(!vc) return message.channel.send({content: `There is currently nothing playing!`});\r\n            audioManager.shuffle(vc);\r\n            message.channel.send({content: `The queue has successfully been shufffled`});\r\n            break;\r\n    }\r\n});\r\n\r\nclient.login(config.token);\r\n```\r\n\r\nDo you have an issue or a question? Go to the [issue page](https://github.com/Luuk-Dev/DiscordAudio) or send me a DM on Discord (Luuk#8524)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluuk-dev%2Fdiscordaudio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluuk-dev%2Fdiscordaudio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluuk-dev%2Fdiscordaudio/lists"}