Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6m16s
14 lines
596 B
TypeScript
Executable File
14 lines
596 B
TypeScript
Executable File
import type { GuildQueue } from "discord-player"
|
|
import type { PlayerMetadata } from "@/types/player"
|
|
import { stopProgressSaving } from "@/utils/player"
|
|
import { t } from "@/utils/i18n"
|
|
|
|
export const name = "disconnect"
|
|
export async function execute(queue: GuildQueue<PlayerMetadata>) {
|
|
// Emitted when the bot leaves the voice channel
|
|
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") })
|
|
}
|