chore: merge branch dev to main #200

Merged
Anri merged 19 commits from dev into main 2024-11-02 17:36:38 +01:00
3 changed files with 20 additions and 8 deletions
Showing only changes of commit 2fc39560f0 - Show all commits

View file

@ -1,8 +1,9 @@
import { SlashCommandBuilder } from "@discordjs/builders"; import { SlashCommandBuilder } from "@discordjs/builders";
import { useMainPlayer, useQueue } from "discord-player"; import { useMainPlayer, useQueue } from "discord-player";
import { ChatInputCommandInteraction, Client, EmbedBuilder } from "discord.js"; import { ChatInputCommandInteraction, Client, EmbedBuilder, Message } from "discord.js";
import { getLocale, getLocalizations } from "../../utils/locales"; import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc"; import { getFilename } from "../../utils/misc";
import { discord_limit_message } from "../../utils/constants";
export default { export default {
scope: () => [], scope: () => [],
@ -125,16 +126,23 @@ export default {
// Load lyrics // Load lyrics
const syncedLyrics = queue.syncedLyrics(data[0]); const syncedLyrics = queue.syncedLyrics(data[0]);
let message: Message<boolean>;
syncedLyrics?.onChange(async (lyrics) => { syncedLyrics?.onChange(async (lyrics) => {
const content = `[${data[0].trackName}]: ${lyrics}`;
if (interaction.channel?.isSendable()) { if (interaction.channel?.isSendable()) {
await interaction.channel?.send({ if (message) {
content, const payload = message.cleanContent + "\n" + lyrics;
}); if (payload.length < discord_limit_message) {
message.edit(payload);
return;
}
}
message = await interaction.channel?.send(
(message ? loc.get("c_lyrics6") + " " : "") +
`${data[0].artistName} : **${data[0].trackName}**\n\n` +
lyrics,
);
} else { } else {
await interaction.followUp({ await interaction.followUp(loc.get("c_lyrics5"));
content,
});
} }
}); });

View file

@ -154,6 +154,8 @@
"c_lyrics2": "Unable to find the lyrics for", "c_lyrics2": "Unable to find the lyrics for",
"c_lyrics3": "Unable to find synchronized lyrics for", "c_lyrics3": "Unable to find synchronized lyrics for",
"c_lyrics4": "It's karaoke time!", "c_lyrics4": "It's karaoke time!",
"c_lyrics5": "Unable to post the lyrics here.",
"c_lyrics6": "More of :",
"c_repeat_name": "repeat", "c_repeat_name": "repeat",
"c_repeat_desc": "Command for the type of music repetition", "c_repeat_desc": "Command for the type of music repetition",

View file

@ -154,6 +154,8 @@
"c_lyrics2": "Impossible de trouver les paroles pour", "c_lyrics2": "Impossible de trouver les paroles pour",
"c_lyrics3": "Impossible de trouver les paroles synchronisées pour", "c_lyrics3": "Impossible de trouver les paroles synchronisées pour",
"c_lyrics4": "C'est parti !", "c_lyrics4": "C'est parti !",
"c_lyrics5": "Impossible de poster les paroles ici.",
"c_lyrics6": "Suite de :",
"c_repeat_name": "repeat", "c_repeat_name": "repeat",
"c_repeat_desc": "Commande relative à la répétition des musiques", "c_repeat_desc": "Commande relative à la répétition des musiques",