From 0454afd2bd183e9e5d432539cec11343c96c0026 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Wed, 9 Feb 2022 15:59:05 +0500 Subject: [PATCH] =?UTF-8?q?v3.3.8=20=D0=A4=D0=B8=D0=BA=D1=81=20clip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/Music/clip.js | 10 +++++----- dashboard/public/docs/updates.md | 4 ++++ package.json | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/commands/Music/clip.js b/commands/Music/clip.js index 6ea1a0c7..de287a0e 100644 --- a/commands/Music/clip.js +++ b/commands/Music/clip.js @@ -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); } diff --git a/dashboard/public/docs/updates.md b/dashboard/public/docs/updates.md index 45e341e4..abe93be9 100644 --- a/dashboard/public/docs/updates.md +++ b/dashboard/public/docs/updates.md @@ -1,3 +1,7 @@ +### JaBa v3.3.8 +* Исправления + * Команда *clip* теперь работает нормально. + ### JaBa v3.3.7 * Добавлено * Локализация необходимых прав в ошибке. diff --git a/package.json b/package.json index 194d8dd3..c066ee3a 100644 --- a/package.json +++ b/package.json @@ -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,