Updated music

This commit is contained in:
2025-03-02 19:31:14 +01:00
parent 132f88e465
commit 3f3dfdb566
6 changed files with 939 additions and 123 deletions

View File

@@ -0,0 +1,40 @@
import { QueueRepeatMode, useMainPlayer } from "discord-player"
import { embedColor } from "~/config/options.js"
import { SubCommand } from "~/typings"
const QueueRepeatModes = {
"off": QueueRepeatMode.OFF,
"track": QueueRepeatMode.TRACK,
"queue": QueueRepeatMode.QUEUE
}
type RepeatMode = keyof typeof QueueRepeatModes
const cmd: SubCommand = async (interaction) => {
await interaction.deferReply()
const mode = interaction.options.getString("mode") as RepeatMode
const player = useMainPlayer()
const queue = player.queues.get(interaction.guildId!)
if (!queue) {
await interaction.editReply({
embeds: [{
description: "There is no queue",
color: embedColor
}]
})
return
}
queue.setRepeatMode(QueueRepeatModes[mode])
await interaction.editReply({
embeds: [{
description: `Repeat mode set to ${mode}`,
color: embedColor
}]
})
}
export default cmd