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:
@@ -1,11 +1,14 @@
|
||||
import { GuildQueue } from 'discord-player'
|
||||
import { PlayerMetadata } from '../../utils/player'
|
||||
|
||||
export default {
|
||||
name: 'emptyChannel',
|
||||
async execute(queue: GuildQueue<PlayerMetadata>) {
|
||||
// Emitted when the voice channel has been empty for the set threshold
|
||||
// Bot will automatically leave the voice channel with this event
|
||||
queue.metadata.channel.send(`Je quitte le vocal car il est vide depuis trop longtemps.`)
|
||||
}
|
||||
}
|
||||
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 = "emptyChannel"
|
||||
export async function execute(queue: GuildQueue<PlayerMetadata>) {
|
||||
// Emitted when the voice channel has been empty for the set threshold
|
||||
// Bot will automatically leave the voice channel with this event
|
||||
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.leaving_empty_channel") })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user