Merge branch 'master' of https://github.com/Androz2091/discord-player
This commit is contained in:
commit
a276d48315
9 changed files with 17 additions and 15 deletions
9
.github/workflows/eslint.yml
vendored
9
.github/workflows/eslint.yml
vendored
|
@ -16,19 +16,16 @@ on:
|
|||
- '!gh-pages'
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
node: ['14', '16']
|
||||
name: ESLint (Node v${{ matrix.node }})
|
||||
name: ESLint (Node v16)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node v${{ matrix.node }}
|
||||
- name: Install Node v16
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
node-version: 16
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
|
|
@ -52,3 +52,8 @@ You have to use `<Queue>.destroy()` to destroy the queue. It will also stop the
|
|||
const queue = player.getQueue(message.guild.id);
|
||||
if (queue) queue.destroy();
|
||||
```
|
||||
|
||||
## Updating filters
|
||||
|
||||
Discord Player v5.x has new option `bufferingTimeout` in queue init options which allows you to set stream buffering timeout before playing.
|
||||
This might be useful if you want to have smooth filters update. By default, it is set to 3 seconds.
|
||||
|
|
|
@ -215,7 +215,7 @@ client.on("interactionCreate", async (interaction) => {
|
|||
if (!queue || !queue.playing) return void interaction.followUp({ content: "❌ | No music is being played!" });
|
||||
const currentTrack = queue.current;
|
||||
const tracks = queue.tracks.slice(0, 10).map((m, i) => {
|
||||
return `${i + 1}. **${m.title}**`;
|
||||
return `${i + 1}. **${m.title}** ([link](${m.url}))`;
|
||||
});
|
||||
|
||||
return void interaction.followUp({
|
||||
|
@ -228,7 +228,7 @@ client.on("interactionCreate", async (interaction) => {
|
|||
: ""
|
||||
}`,
|
||||
color: 0xff0000,
|
||||
fields: [{ name: "Now Playing", value: `🎶 | **${currentTrack.title}**` }]
|
||||
fields: [{ name: "Now Playing", value: `🎶 | **${currentTrack.title}** ([link](${currentTrack.url}))` }]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
"dependencies": {
|
||||
"@discordjs/opus": "^0.5.3",
|
||||
"discord-player": "^5.0.0-dev.39f503a.1625470163",
|
||||
"discord.js": "^13.0.0-dev.fe5d56c.1625443439"
|
||||
"discord.js": "^13.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "discord-player",
|
||||
"version": "5.0.0-dev",
|
||||
"version": "5.0.0",
|
||||
"description": "Complete framework to facilitate music commands using discord.js",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
|
@ -117,7 +117,7 @@ class Player extends EventEmitter<PlayerEvents> {
|
|||
if (!this.queues.has(queue.guild.id)) return;
|
||||
queue.destroy();
|
||||
this.emit("channelEmpty", queue);
|
||||
}, queue.options.leaveOnEmptyCooldown || 0);
|
||||
}, queue.options.leaveOnEmptyCooldown || 0).unref();
|
||||
queue._cooldownsTimeout.set(`empty_${oldState.guild.id}`, timeout);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -657,7 +657,7 @@ class Queue<T = unknown> {
|
|||
this.connection.playStream(resource).then(() => {
|
||||
this.setVolume(this.options.initialVolume);
|
||||
});
|
||||
}, this.#getBufferingTimeout());
|
||||
}, this.#getBufferingTimeout()).unref();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -91,7 +91,7 @@ class Util {
|
|||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
static wait(time: number) {
|
||||
return new Promise((r) => setTimeout(r, time));
|
||||
return new Promise((r) => setTimeout(r, time).unref());
|
||||
}
|
||||
|
||||
static noop() {} // eslint-disable-line @typescript-eslint/no-empty-function
|
||||
|
|
Loading…
Reference in a new issue