Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Coverage

on: [push, pull_request]

jobs:
run:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
cache: npm
node-version: 22

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Upload results to Codecov
uses: codecov/codecov-action@v5
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
cache: npm
node-version: 22
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/coverage
/docs
/lib
node_modules/
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
<div align="center">
<img alt="Discolink" src="assets/music-album.png" width="120" />

[Icon designed by juicy_fish](https://www.flaticon.com/authors/juicy-fish)
[Icon by juicy_fish](https://www.flaticon.com/authors/juicy-fish)
<br/>
[Documentation](https://github.com/execaman/discolink/wiki) | [API Reference](https://execaman.github.io/discolink)
[API Reference](https://execaman.github.io/discolink) | [Coverage](http://app.codecov.io/gh/execaman/discolink)

![NPM Version](https://img.shields.io/npm/v/discolink?style=flat&logo=npm)
![NPM Downloads](https://img.shields.io/npm/dm/discolink)
![Codecov Coverage](https://img.shields.io/codecov/c/github/execaman/discolink?logo=codecov)

</div>

## 🎯 Purpose

The goal of this library is to abstract away obvious steps involved in the process of acting as an intermediary between [Lavalink](https://lavalink.dev/api) and [Discord](https://discord.com/developers/docs/events/gateway) to give developers a cleaner yet intuitive interface to work with.

## ✨ Features

- Built-in queue system
- Automatic player relocation
- Built-in custom plugin support
- Automatic relevant-node selection

## ⚙️ Requirements

- **Runtime** - one of the following:
Expand Down Expand Up @@ -59,7 +53,8 @@ client.on("raw", (payload) => {
client.login();
```

## 📝 Additional Notes
## 📝 Implementation

- Handle track end reasons other than `cleanup` and `finished` manually
- Always check for `reconnecting` or `changingNode` when handling voice states
- Handle track end reasons other than `cleanup` and `finished`
- Handle voice states with care, e.g. `reconnecting`, `changingNode`, etc.
- Handle queue destruction/relocation, e.g. guild/channel delete, node close/disconnect, etc.
26 changes: 26 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { createDefaultPreset } from "ts-jest";
import type { Config } from "jest";

const config: Config = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: [
"src/Functions/**/*.ts",
"src/Queue/Playlist.ts",
"src/Queue/Track.ts",
"!src/Typings/**/*",
"!src/**/index.ts",
],
coverageDirectory: "coverage",
coverageProvider: "v8",
globals: {
$clientName: "name",
$clientVersion: "version",
$clientRepository: "repository",
},
preset: "ts-jest",
testEnvironment: "node",
...createDefaultPreset(),
};

export default config;
Loading