Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

musicord

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

musicord

A simple, powerful, and user-friendly music package for your Discord bot. Designed for DJS v14.

  • 0.0.1-beta
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Musicord logo Made with Typescript
Downloads

A simple, powerful, and user-friendly music package for your Discord bot. Made for Discord.js v14 and Discord.js/voice v9.

🔑 Features

  • Easy to use
  • Multiple server
  • Audio filters
  • Lightweightmu
  • Faster than other packages

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.

🔩 Installation

Install @discordjs/opus and FFmpeg

$ npm install @discordjs/opus ffmpeg

Install musicord

$ npm install musicord

Tweetnacl is recommended for better performance.

If you encounter installation errors, please refer to this page of the documentation

💻 Code example

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');

🌌 Projects made with musicord

🚀 Others

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.

Discord server widget image

Made with ❤ by RemyK

Keywords

FAQs

Package last updated on 01 Apr 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc