Fix duplicate streamWatching, locale guild et console log/error
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 3m43s

This commit is contained in:
2025-06-11 02:50:58 +02:00
parent 0cc81d6430
commit e714e94f85
31 changed files with 396 additions and 308 deletions

View File

@@ -1,10 +1,14 @@
import type { GuildQueue, Track } from "discord-player"
import type { PlayerMetadata } from "@/types/player"
import { t } from "@/utils/i18n"
import { t, getGuildLocale } from "@/utils/i18n"
export const name = "audioTracksAdd"
export async function execute(queue: GuildQueue<PlayerMetadata>, track: Track[]) {
// Emitted when the player adds multiple songs to its queue
if (!queue.metadata.channel) return
if ("send" in queue.metadata.channel) return queue.metadata.channel.send({ content: t(queue.guild.preferredLocale, "player.track_added_playlist", { count: track.length.toString() }) })
if ("send" in queue.metadata.channel) {
const guildLocale = await getGuildLocale(queue.guild.id)
return queue.metadata.channel.send({ content: t(guildLocale, "player.track_added_playlist", { count: track.length.toString() }) })
}
}