check if song is live

This commit is contained in:
JonnyBro 2021-12-28 17:33:58 +05:00
parent 1cdced9c2f
commit 6b6fafd1b8
3 changed files with 11 additions and 5 deletions

View file

@ -64,9 +64,15 @@ class JaBa extends Client {
this.player
.on("playSong", async (queue, song) => {
const m = await queue.textChannel.send(this.translate("music/play:NOW_PLAYING", { songName: song.name }))
if (!song.isLive) {
setTimeout(() => {
m.delete();
if (!m.deleted) m.delete();
}, song.duration * 1000);
} else {
setTimeout(() => {
if (!m.deleted) m.delete();
}, 600 * 1000);
}
})
.on("addSong", (queue, song) => queue.textChannel.send(this.translate("music/play:ADDED_QUEUE", { songName: song.name })))
.on("addList", (queue, playlist) => queue.textChannel.send(this.translate("music/play:ADDED_QUEUE_COUNT", { songCount: playlist.songs.length })))

View file

@ -18,5 +18,5 @@
"STOP_EMPTY": "I've just stopped the music as everyone disconnected from the channel.",
"RESULTS_CANCEL": "Search cancelled!",
"LIVE": "Live",
"ERR_OCCURRED": "An error occurred... Code: `{{error}}`"
"ERR_OCCURRED": "An error occurred, skipping...\n`{{error}}`"
}

View file

@ -18,5 +18,5 @@
"STOP_EMPTY": "Воспроизведение окончено, т.к. все вышли из голосового канала.",
"RESULTS_CANCEL": "Поиск отменён!",
"LIVE": "Прямая трансляция",
"ERR_OCCURRED": "Произошла ошибка... Код ошибки: `{{error}}`"
"ERR_OCCURRED": "Произошла ошибка, пропускаю...\n`{{error}}`"
}