mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 20:54:58 +05:00
v3.3.8
Фикс clip
This commit is contained in:
parent
476ed2a8dd
commit
0454afd2bd
3 changed files with 10 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
const Command = require("../../base/Command"),
|
||||
fs = require("fs"),
|
||||
{ joinVoiceChannel, createAudioResource, createAudioPlayer, getVoiceConnection } = require("@discordjs/voice");
|
||||
{ joinVoiceChannel, createAudioResource, createAudioPlayer, getVoiceConnection, AudioPlayerStatus } = require("@discordjs/voice");
|
||||
|
||||
class Clip extends Command {
|
||||
constructor(client) {
|
||||
|
@ -38,17 +38,17 @@ class Clip extends Command {
|
|||
|
||||
const resource = createAudioResource(fs.createReadStream(`./clips/${clip}.mp3`));
|
||||
const player = createAudioPlayer()
|
||||
.on("error", error => {
|
||||
.on("error", err => {
|
||||
connection.destroy();
|
||||
console.error("Error:", error.message, "with track", error.resource.metadata.title);
|
||||
console.error(err.message);
|
||||
});
|
||||
|
||||
player.play(resource);
|
||||
connection.subscribe(player);
|
||||
|
||||
setTimeout(() => {
|
||||
player.on(AudioPlayerStatus.Idle, () => {
|
||||
connection.destroy();
|
||||
}, 60 * 1000);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
### JaBa v3.3.8
|
||||
* Исправления
|
||||
* Команда *clip* теперь работает нормально.
|
||||
|
||||
### JaBa v3.3.7
|
||||
* Добавлено
|
||||
* Локализация необходимых прав в ошибке.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "jaba",
|
||||
"version": "3.3.7",
|
||||
"version": "3.3.8",
|
||||
"description": "A very complete Discord bot (more than 100 commands) that uses the Discord.js",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
|
|
Loading…
Reference in a new issue