Blaze

BlaZe™ is an advanced Discord music bot built with Discord.js v14, Kazagumo and Lavalink, offering seamless music playback, queue management, powerful player co

Node.js Other 作者:lmveld
部署此模板

简介

README.md

目录
在 GitHub 上打开

Overview

A modular Discord application built using modern JavaScript technologies and a dedicated audio-processing infrastructure.

The project integrates Discord.js, Kazagumo, Shoukaku and Lavalink to manage music playback, player sessions, voice communication and audio processing.

Its architecture focuses on modularity, reliability, maintainability and extensibility.

Project Information

Property Details
Runtime Node.js 20+
Language JavaScript
Discord Library Discord.js v14
Music Manager Kazagumo
Audio Manager Shoukaku
Audio Server Lavalink v4
Database MongoDB
Repository fraudelis/blaze
License MIT

Core Systems

Music Playback
  • Track searching and loading.
  • Lavalink audio streaming.
  • Automatic track progression.
  • Voice connection management.
  • Player initialization.
  • Playback state management.
Queue Management
  • Add and remove tracks.
  • Shuffle playback order.
  • Clear upcoming tracks.
  • Display queue information.
  • Automatic next-track handling.
Interactive Controls
  • Play and pause.
  • Resume playback.
  • Skip and stop.
  • Volume adjustment.
  • Previous track support, if implemented.
  • Audio filter management.
Personal Collections
  • Favourite tracks.
  • Personal playlists.
  • Saved music collections.
  • Persistent user preferences.

Technology Stack

Technology Purpose
Node.js Runtime
JavaScript Development
Discord.js Discord API
Kazagumo Music management
Shoukaku Lavalink communication
Lavalink Audio processing
MongoDB Persistent storage

System Architecture

MERMAID
flowchart TD
    A["Discord User"] --> B["Discord API"]
    B --> C["Discord.js"]
    C --> D["Command Handler"]
    D --> E["Kazagumo"]
    E --> F["Shoukaku"]
    F --> G["Lavalink"]
    G --> H["Audio Processing"]
    H --> I["Discord Voice"]
    D --> J["MongoDB"]
    E --> K["Player Events"]

Playback Workflow

MERMAID
flowchart TD
    A["Track Request"] --> B["Input Validation"]
    B --> C["Track Search"]
    C --> D["Track Loading"]
    D --> E["Player Initialization"]
    E --> F["Queue Processing"]
    F --> G["Audio Playback"]
    G --> H["Track Completion"]
    H --> I["Next Track"]

Audio Filters

Filter Function
Bass Boost Enhance low frequencies
Nightcore Modify speed and pitch
Vaporwave Slower playback effect
Karaoke Vocal reduction
Tremolo Volume modulation
Vibrato Pitch modulation
Rotation Stereo rotation
Equalizer Frequency adjustment
Low-pass Frequency filtering
Timescale Playback speed

Filter availability depends on Lavalink plugins and configuration.


Installation

Requirements
  • Node.js 20+
  • npm
  • Discord application
  • Lavalink v4
  • MongoDB, if required
Clone Repository
Bash
git clone https://github.com/fraudelis/blaze.git
cd blaze
Install Dependencies
Bash
npm install
Configure Environment

Create a .env file:

Env
TOKEN=YOUR_DISCORD_BOT_TOKEN
CLIENT_ID=YOUR_DISCORD_APPLICATION_ID

MONGO_URI=YOUR_MONGODB_URI

LAVALINK_HOST=localhost
LAVALINK_PORT=2333
LAVALINK_PASSWORD=YOUR_LAVALINK_PASSWORD
Start Application
Bash
npm start

If no start script exists:

Bash
node index.js

Example application.yml:

YAML
server:
  port: 2333

lavalink:
  server:
    password: "YOUR_SECURE_PASSWORD"
    sources:
      youtube: false
      bandcamp: true
      soundcloud: true
      twitch: true
      vimeo: true
      http: true
      local: false

Project Structure

TEXT
blaze/
│
├── src/
│   ├── commands/
│   │   ├── music/
│   │   └── utility/
│   │
│   ├── events/
│   │   ├── client/
│   │   └── music/
│   │
│   ├── handlers/
│   ├── database/
│   ├── music/
│   ├── structures/
│   └── utils/
│
├── config/
├── models/
├── .env.example
├── .gitignore
├── package.json
└── index.js

Adjust this structure to match the actual repository.


Player Lifecycle

MERMAID
stateDiagram-v2
    [*] --> Idle
    Idle --> Connecting
    Connecting --> Ready
    Ready --> Playing
    Playing --> Paused
    Paused --> Playing
    Playing --> Idle: Queue Empty
    Ready --> Destroyed
    Destroyed --> [*]

Development Standards

Principle Description
Modularity Independent application components
Reliability Connection and error handling
Performance Efficient asynchronous operations
Maintainability Consistent code structure
Security Protected credentials
Scalability Extensible architecture

Security

  • Store credentials in environment variables.
  • Never publish private tokens.
  • Validate user permissions.
  • Protect database credentials.
  • Validate incoming interactions.
  • Keep dependencies updated.

Troubleshooting

Problem Solution
Invalid token Verify Discord credentials
Lavalink unavailable Check host and port
Authentication failed Verify Lavalink password
No search results Check configured sources
Database error Verify MongoDB URI
Voice connection failed Check bot permissions
Startup error Review application logs

Contribution Guidelines

  1. Fork the repository.
  2. Create a development branch.
  3. Implement your changes.
  4. Test your implementation.
  5. Commit your changes.
  6. Submit a pull request.

License

Distributed under the MIT License. See the LICENSE file for details.


变量

部署时由你填写,它们会成为你部署的环境变量。

  • DISCORD_TOKEN DISCORD_TOKEN 必填, 机密
  • DISCORD_CLIENT_ID DISCORD_CLIENT_ID 必填
  • BOT_OWNER_IDS BOT_OWNER_IDS 必填
  • BOT_PREFIX BOT_PREFIX 必填
  • BOT_COLOR BOT_COLOR 必填

如何部署

  1. 1 打开部署页面为部署命名。确认时再登录即可。
  2. 2 填写变量填写模板所需的值,它们会保存为你部署的环境变量。
  3. 3 检查资源从你套餐的共享资源池中划拨,然后启动。所有账号都从免费套餐开始。

登录后举报

举报与账号绑定,以防止滥用。

登录