
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
A simple, powerful, and user-friendly music package for your Discord bot. Designed for DJS v14.
Note that this package is still under development, if you encounter any errors, please join the RemyK Discord server so that this problem can be fixed as soon as possible.
$ npm install @discordjs/opus ffmpeg
$ npm install musicord
Tweetnacl is recommended for better performance.
If you encounter installation errors, please refer to this page of the documentation
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { Client } = require('discord.js');
const { Musicord, ApplicationCommandSchema } = require('musicord');
const client = new Client({
intents: 32767
});
const commandsSchema = new ApplicationCommandSchema({
play: {
description: 'Play a song',
implemented: true,
options: {
name: 'link',
description: 'YouTube URL',
required: true,
type: 3
}
}
});
const musicordPlayer = new Musicord();
const rest = new REST({ version: '10' }).setToken('token');
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(
Routes.applicationGuildCommands('client id', 'guild id'),
{ body: commandsSchema.extract() },
)
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();
client.on('interactionCreate', (interaction) => {
if(!command.isCommand()) return;
if (interaction.commandName === 'play') {
const msgArgs = interaction.options.get('link').value
if (!msgArgs) return interaction.reply('Argument required');
const msgMember = interaction.guild.members.cache.get(interaction.member.user.id);
if (msgMember && msgMember.voice.channel) {
if (musicordPlayer.existQueue(interaction.guild)) {
const queue = musicordPlayer.getQueue(interaction.guild);
if (queue) await queue.play(msgArgs, msgMember.voice.channel);
const queueInfo = musicordPlayer.getQueueInfo(interaction.guild);
if (queueInfo && queue) interaction.reply(`${queueInfo.songs[1].title} has been added to the queue`)
} else {
const queue = musicordPlayer.initQueue(interaction.guild, {
textChannel: interaction.channel ,
voiceChannel: msgMember.voice.channel
});
if (queue) {
interaction.deferReply();
await queue.play(msgArgs, msgMember.voice.channel)
}
const queueInfo = musicordPlayer.getQueueInfo(interaction.guild);
if (queueInfo) return await interaction.editReply(`Playing ${queueInfo.songs[0].title}`)
}
}
}
});
client.login('token');
Before creating an issue, be sure that it has not already been deferred and try to come up with a simple approach to the issue so that deferral is accessible to all.
In order to submit a PR, make sure you have read the contribution guide
Thanks a lot to ArthurLeo who supported me during the development of this project, and who helps me daily to maintain it.
I would also like to thank all the amazing members of my server who are helping to make this project happen !
Note: This package is not affiliated with Discord Inc. or YouTube Inc.
This package is under Apache-2.0 license.
FAQs
A simple, powerful, and user-friendly music package for your Discord bot. Designed for DJS v14.
The npm package musicord receives a total of 2 weekly downloads. As such, musicord popularity was classified as not popular.
We found that musicord demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.