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
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 3m43s
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { GuildQueue } from "discord-player"
|
||||
import type { PlayerMetadata } from "@/types/player"
|
||||
import { stopProgressSaving } from "@/utils/player"
|
||||
import { t } from "@/utils/i18n"
|
||||
import { t, getGuildLocale } from "@/utils/i18n"
|
||||
|
||||
export const name = "disconnect"
|
||||
export async function execute(queue: GuildQueue<PlayerMetadata>) {
|
||||
@@ -9,5 +9,9 @@ export async function execute(queue: GuildQueue<PlayerMetadata>) {
|
||||
await stopProgressSaving(queue.guild.id, queue.player.client.user?.id ?? "")
|
||||
|
||||
if (!queue.metadata.channel) return
|
||||
if ("send" in queue.metadata.channel) return queue.metadata.channel.send({ content: t(queue.guild.preferredLocale, "player.disconnect") })
|
||||
|
||||
if ("send" in queue.metadata.channel) {
|
||||
const guildLocale = await getGuildLocale(queue.guild.id)
|
||||
return queue.metadata.channel.send({ content: t(guildLocale, "player.disconnect") })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user