26 lines
737 B
TypeScript
26 lines
737 B
TypeScript
import { embedColor } from "config/options"
|
|
import { useMainPlayer } from "discord-player"
|
|
import { ChatInputCommandInteraction } from "discord.js"
|
|
|
|
export default async function volume(interaction: ChatInputCommandInteraction) {
|
|
await interaction.deferReply()
|
|
|
|
const volume = interaction.options.getNumber("volume")!
|
|
const player = useMainPlayer()
|
|
const queue = player.queues.get(interaction.guildId!)
|
|
|
|
if (!queue) {
|
|
await interaction.editReply({
|
|
content: "There is no queue"
|
|
})
|
|
return
|
|
}
|
|
|
|
queue.node.setVolume(volume)
|
|
await interaction.editReply({
|
|
embeds: [{
|
|
description: `Volume set to ${volume}`,
|
|
color: embedColor
|
|
}]
|
|
})
|
|
} |