Fix duplicate streamWatching, locale guild et console log/error
Build and Push Docker Image / build-and-push (push) Successful in 3m43s
Build and Push Docker Image / build-and-push (push) Successful in 3m43s
This commit is contained in:
@@ -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 = "playerStart"
|
||||
export async function execute(queue: GuildQueue<PlayerMetadata>, track: Track) {
|
||||
// Emitted when the player starts to play a song
|
||||
if (!queue.metadata.channel) return
|
||||
if ("send" in queue.metadata.channel) await queue.metadata.channel.send({ content: t(queue.guild.preferredLocale, "player.now_playing", { title: track.title, author: track.author }) })
|
||||
|
||||
if ("send" in queue.metadata.channel) {
|
||||
const guildLocale = await getGuildLocale(queue.guild.id)
|
||||
await queue.metadata.channel.send({ content: t(guildLocale, "player.now_playing", { title: track.title, author: track.author }) })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user