Fix duplicate streamWatching, locale guild et console log/error
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 3m43s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 3m43s
This commit is contained in:
@@ -8,6 +8,7 @@ import type { TrackSearchResult } from "@/types/player"
|
||||
import type { GuildPlayer } from "@/types/schemas"
|
||||
import dbGuild from "@/schemas/guild"
|
||||
import { t } from "@/utils/i18n"
|
||||
import { logConsoleError } from "@/utils/console"
|
||||
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName("play")
|
||||
@@ -55,7 +56,7 @@ export async function execute(interaction: ChatInputCommandInteraction) {
|
||||
}
|
||||
|
||||
try { if (!queue.connection) await queue.connect(voiceChannel) }
|
||||
catch (error) { console.error(error) }
|
||||
catch (error) { logConsoleError('discord_player', 'play.connect_error', {}, error as Error) }
|
||||
|
||||
const guildProfile = await dbGuild.findOne({ guildId: queue.guild.id })
|
||||
if (!guildProfile) return interaction.reply({ content: t(interaction.locale, "common.database_not_found"), flags: MessageFlags.Ephemeral })
|
||||
@@ -93,7 +94,7 @@ export async function execute(interaction: ChatInputCommandInteraction) {
|
||||
const track_source = track.source === "spotify" ? t(interaction.locale, "player.sources.spotify") : track.source === "youtube" ? t(interaction.locale, "player.sources.youtube") : t(interaction.locale, "player.sources.unknown")
|
||||
return await interaction.followUp(t(interaction.locale, "player.loading_track", { title: track.title, author: track.author, source: track_source }))
|
||||
}
|
||||
catch (error) { console.error(error) }
|
||||
catch (error) { logConsoleError('discord_player', 'play.execution_error', {}, error as Error) }
|
||||
finally { queue.tasksQueue.release() }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user