npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aliana-musicard-discord-bot-example

v1.0.0

Published

Example Discord music bot using aliana-musicard and aliana-client

Downloads

5

Readme

Discord Music Bot Example

This example demonstrates how to create a Discord music bot using aliana-musicard and aliana-client.

Features

  • 🎵 Play music from YouTube
  • 🎨 Automatically generates beautiful music cards when tracks play
  • 🔄 Queue system with autoplay support
  • ⚡ Uses Lavalink v4 for high-quality audio

Installation

npm install

Setup

  1. Create a Discord bot at https://discord.com/developers/applications
  2. Enable these intents in the Bot section:
    • Server Members Intent
    • Message Content Intent
  3. Copy your bot token
  4. Set your environment variables:
export DISCORD_TOKEN="your-bot-token-here"
export CLIENT_ID="your-bot-client-id"

Or create a .env file:

DISCORD_TOKEN=your-bot-token-here
CLIENT_ID=your-bot-client-id

Run

npm start

For development with auto-reload:

npm run dev

Commands

Music Playback

  • !play <song> - Play a song or add to queue
  • !stop - Stop playback and clear queue
  • !skip - Skip current track
  • !pause - Pause playback
  • !resume - Resume playback
  • !queue - Show current queue
  • !np or !nowplaying - Show current track with music card

Settings

  • !autoplay - Toggle autoplay (continues with similar songs)
  • !help - Show all commands

How It Works

Music Cards

When a track starts playing, the bot automatically:

  1. Generates a beautiful music card using aliana-musicard
  2. Randomly selects from 8 available themes
  3. Displays track info (title, artist, album art)
  4. Sends it as an embed in Discord

Lavalink Integration

The bot uses aliana-client to connect to a public Lavalink server:

  • Host: lava-v3.ajieblogs.eu.org
  • Port: 80
  • No setup required - works out of the box!

Customization

Change Themes

Edit the themes array in index.js:

const themes = ['cherry-blossom', 'cyberpunk-anime', 'neon-grid', 'space'];

Available themes:

  • cherry-blossom (Anime)
  • cyberpunk-anime (Anime)
  • forest-nature (Nature)
  • ocean-sunset (Nature)
  • minecraft-overworld (Minecraft)
  • minecraft-nether (Minecraft)
  • neon-grid (Futuristic)
  • space (Futuristic)

Use Your Own Lavalink Server

Update the nodes configuration:

nodes: [
  {
    authorization: "your-password",
    host: "your-server.com",
    port: 2333,
    identifier: "My Node",
    secure: false,  // set to true for HTTPS
  },
]

Local Development (Unpublished Package)

If you're testing the aliana-musicard package before it's published to npm:

Option 1: File Path (Already Configured)

The package.json already uses a file path:

{
  "dependencies": {
    "aliana-musicard": "file:../../server/musicard"
  }
}

Just build the package first:

cd ../../server/musicard
npm run build
cd ../../examples/discord-bot
npm install
npm start

Option 2: Using npm link

# From the musicard package directory
cd server/musicard
npm run build
npm link

# From the example bot directory
cd examples/discord-bot
npm link aliana-musicard
npm install
npm start

Troubleshooting

Bot doesn't connect to voice

  • Ensure bot has GuildVoiceStates intent enabled
  • Check Lavalink server is running and accessible
  • Verify bot has permissions to join voice channels

Music cards not generating

  • Make sure @napi-rs/canvas is installed correctly
  • Check album artwork URLs are accessible
  • Verify theme names match available themes

Commands not working

  • Enable MessageContent intent in Discord Developer Portal
  • Ensure bot has permissions to read and send messages

Links

License

MIT © Npg