Réécriture complète 4.0
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6m16s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6m16s
This commit is contained in:
16
src/buttons/player/stop.ts
Normal file
16
src/buttons/player/stop.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { MessageFlags } from "discord.js"
|
||||
import type { ButtonInteraction } from "discord.js"
|
||||
import { useQueue } from "discord-player"
|
||||
import { stopProgressSaving } from "@/utils/player"
|
||||
import { t } from "@/utils/i18n"
|
||||
|
||||
export const id = "player_stop"
|
||||
export async function execute(interaction: ButtonInteraction) {
|
||||
await stopProgressSaving(interaction.guild?.id ?? "", interaction.client.user.id)
|
||||
|
||||
const queue = useQueue(interaction.guild?.id ?? "")
|
||||
if (!queue) return
|
||||
|
||||
queue.delete()
|
||||
return interaction.followUp({ content: t(interaction.locale, "player.stopped"), flags: MessageFlags.Ephemeral })
|
||||
}
|
||||
Reference in New Issue
Block a user