Files
illegitimate-bot/src/commands/music/leave.ts
2025-01-12 19:40:20 +01:00

28 lines
682 B
TypeScript

import { useMainPlayer } from "discord-player"
import { embedColor } from "~/config/options.js"
import { SubCommand } from "~/typings"
const cmd: SubCommand = async (interaction) => {
const player = useMainPlayer()
const queue = player.queues.get(interaction.guildId!)
if (!queue) {
await interaction.reply({
embeds: [{
description: "There is no music playing",
color: embedColor
}]
})
return
}
queue.delete()
await interaction.reply({
embeds: [{
description: "Left the voice channel",
color: embedColor
}]
})
}
export default cmd