chore: upgrade dependencies (#213)
Some checks failed
Publish latest version / build (push) Failing after 50s
Some checks failed
Publish latest version / build (push) Failing after 50s
Reviewed-on: #213 Co-authored-by: Mylloon <kennel.anri@tutanota.com> Co-committed-by: Mylloon <kennel.anri@tutanota.com>
This commit is contained in:
parent
f851ac44f6
commit
75ef50c85c
17 changed files with 1847 additions and 438 deletions
2144
package-lock.json
generated
2144
package-lock.json
generated
File diff suppressed because it is too large
Load diff
15
package.json
15
package.json
|
@ -19,20 +19,19 @@
|
|||
"author": "La confrérie du Kassoulait",
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"@discord-player/extractor": "^4.5.1",
|
||||
"@discordjs/rest": "^2.4.0",
|
||||
"discord-player": "^6.7.1",
|
||||
"discord-player-youtubei": "^1.3.5",
|
||||
"discord.js": "^14.16.3",
|
||||
"mediaplex": "^1.0.0",
|
||||
"@discord-player/extractor": "^7.0.0",
|
||||
"@discordjs/rest": "^2.4.2",
|
||||
"discord-player": "^7.0.0",
|
||||
"discord-player-youtubei": "^1.3.7",
|
||||
"discord.js": "^14.17.2",
|
||||
"moment-timezone": "^0.5.46",
|
||||
"sqlite3": "^5.1.7",
|
||||
"typescript": "^5.7.2",
|
||||
"uuid": "^11.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "~8.17.0",
|
||||
"@typescript-eslint/parser": "~8.17.0",
|
||||
"@typescript-eslint/eslint-plugin": "~8.19.0",
|
||||
"@typescript-eslint/parser": "~8.19.0",
|
||||
"dotenv": "~16.4.7",
|
||||
"prettier-eslint": "~16.3.0",
|
||||
"ts-node-dev": "~2.0.0",
|
||||
|
|
|
@ -5,6 +5,7 @@ import {
|
|||
Client,
|
||||
Message,
|
||||
MessageComponentInteraction,
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import { getLocale } from "../utils/locales";
|
||||
|
||||
|
@ -58,7 +59,7 @@ export const collect = (
|
|||
if (!button) {
|
||||
interaction.reply({
|
||||
content: loc.get("e_interacreate_no_button"),
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import {
|
|||
Colors,
|
||||
CommandInteraction,
|
||||
EmbedBuilder,
|
||||
MessageFlags,
|
||||
NonThreadGuildBasedChannel,
|
||||
} from "discord.js";
|
||||
import "../../modules/string";
|
||||
|
@ -66,7 +67,7 @@ export default {
|
|||
// Category doesn't exist or is not included
|
||||
return interaction.reply({
|
||||
content: `${loc.get("c_archive3")} \`${desiredCat}\``,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import {
|
|||
Client,
|
||||
Colors,
|
||||
EmbedBuilder,
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import "../../modules/string";
|
||||
import { getLocale, getLocalizations } from "../../utils/locales";
|
||||
|
@ -110,13 +111,13 @@ export default {
|
|||
|
||||
const command = NameNotLocalized(client, possible_command);
|
||||
if (!command) {
|
||||
return interaction.reply({ content: error, ephemeral: true });
|
||||
return interaction.reply({ content: error, flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
|
||||
const scope = client.commands.list.get(command.name)?.scope();
|
||||
if (scope!.length > 0 && scope?.find((id) => id === interaction.guildId) === undefined) {
|
||||
// Command not available for the current guild
|
||||
return interaction.reply({ content: error, ephemeral: true });
|
||||
return interaction.reply({ content: error, flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
|
||||
let subcommand = undefined;
|
||||
|
@ -128,7 +129,7 @@ export default {
|
|||
|
||||
if (!command || subcommand === undefined) {
|
||||
// Sub/Command don't exist
|
||||
return interaction.reply({ content: error, ephemeral: true });
|
||||
return interaction.reply({ content: error, flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
|
||||
// Loads the data according to the user's locals
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction, Client, Message } from "discord.js";
|
||||
import { ChatInputCommandInteraction, Client } from "discord.js";
|
||||
import { getLocale, getLocalizations } from "../../utils/locales";
|
||||
import { getFilename } from "../../utils/misc";
|
||||
|
||||
|
@ -18,14 +18,14 @@ export default {
|
|||
interaction: async (interaction: ChatInputCommandInteraction, client: Client) => {
|
||||
const loc = getLocale(client, interaction.locale);
|
||||
|
||||
const sent = (await interaction.reply({
|
||||
const sent = await interaction.reply({
|
||||
content: "Pinging...",
|
||||
fetchReply: true,
|
||||
})) as Message;
|
||||
withResponse: true,
|
||||
});
|
||||
|
||||
interaction.editReply(
|
||||
`${loc?.get("c_ping1")}: \
|
||||
${sent.createdTimestamp - interaction.createdTimestamp}ms
|
||||
${sent.resource!.message!.createdTimestamp - interaction.createdTimestamp}ms
|
||||
${loc?.get("c_ping2")}: ${client.ws.ping}ms.`,
|
||||
);
|
||||
},
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChannelType, Client, Colors, CommandInteraction, EmbedBuilder } from "discord.js";
|
||||
import {
|
||||
ChannelType,
|
||||
Client,
|
||||
Colors,
|
||||
CommandInteraction,
|
||||
EmbedBuilder,
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import "../../modules/string";
|
||||
import { getLocale, getLocalizations } from "../../utils/locales";
|
||||
import { getFilename } from "../../utils/misc";
|
||||
|
@ -59,7 +66,7 @@ export default {
|
|||
// Category doesn't exist or is not allowed
|
||||
return interaction.reply({
|
||||
content: `${loc.get("c_prep3")} \`${desired_cat}\``,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import {
|
|||
ButtonStyle,
|
||||
ChatInputCommandInteraction,
|
||||
Client,
|
||||
MessageFlags,
|
||||
ModalBuilder,
|
||||
TextInputBuilder,
|
||||
TextInputStyle,
|
||||
|
@ -162,13 +163,13 @@ export default {
|
|||
.then((msg) =>
|
||||
interaction.reply({
|
||||
content: msg as string,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
}),
|
||||
)
|
||||
.catch((err) => {
|
||||
interaction.reply({
|
||||
content: err,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
});
|
||||
} else {
|
||||
|
@ -233,16 +234,16 @@ export default {
|
|||
.setStyle(ButtonStyle.Primary),
|
||||
);
|
||||
|
||||
const message = await interaction.reply({
|
||||
ephemeral: true,
|
||||
const callback = await interaction.reply({
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
embeds: [list],
|
||||
components: [row],
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
|
||||
// Buttons interactions
|
||||
collect(client, interaction, idPrec, message);
|
||||
collect(client, interaction, idNext, message);
|
||||
collect(client, interaction, idPrec, callback.resource!.message!);
|
||||
collect(client, interaction, idNext, callback.resource!.message!);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -254,7 +255,7 @@ export default {
|
|||
if (id === null) {
|
||||
return interaction.reply({
|
||||
content: loc.get(`c_${filename}2`),
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -264,7 +265,7 @@ export default {
|
|||
) {
|
||||
return interaction.reply({
|
||||
content: loc.get(`c_${filename}3`),
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -276,7 +277,7 @@ export default {
|
|||
return deleteReminder(client, reminderInfo.creation_date, reminderInfo.user_id).then(() =>
|
||||
interaction.reply({
|
||||
content: `Reminder **#${id}** supprimé !`,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { useMainPlayer, useQueue } from "discord-player";
|
||||
import { ChatInputCommandInteraction, Client, EmbedBuilder, Message } from "discord.js";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
Client,
|
||||
EmbedBuilder,
|
||||
Message,
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import { getLocale, getLocalizations } from "../../utils/locales";
|
||||
import { getFilename } from "../../utils/misc";
|
||||
import { discord_limit_message } from "../../utils/constants";
|
||||
|
@ -90,7 +96,7 @@ export default {
|
|||
await interaction.deferReply();
|
||||
|
||||
const player = useMainPlayer();
|
||||
const queue = useQueue(interaction.guildId!);
|
||||
const queue = useQueue();
|
||||
if (request) {
|
||||
if (
|
||||
interaction.options.getSubcommand() ===
|
||||
|
@ -110,7 +116,7 @@ export default {
|
|||
if (track) {
|
||||
try {
|
||||
data = await player.lyrics.search({
|
||||
q: track.cleanTitle + " " + queue.history.currentTrack?.author,
|
||||
q: track.author + " " + track.cleanTitle,
|
||||
});
|
||||
} catch {
|
||||
return await interaction.followUp(`❌ | ${loc.get("c_lyrics2")} \`${track.title}\``);
|
||||
|
@ -169,7 +175,7 @@ export default {
|
|||
|
||||
return await interaction.followUp({
|
||||
content: `🎤 | ${loc.get("c_lyrics4")}`,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ export default {
|
|||
|
||||
interaction: async (interaction: ChatInputCommandInteraction, client: Client) => {
|
||||
const loc = getLocale(client, interaction.locale);
|
||||
const queue = useQueue(interaction.guildId!);
|
||||
const queue = useQueue();
|
||||
|
||||
if (queue) {
|
||||
const embed = new EmbedBuilder();
|
||||
|
|
|
@ -5,6 +5,7 @@ import {
|
|||
ChatInputCommandInteraction,
|
||||
Client,
|
||||
EmbedBuilder,
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import { getLocale, getLocalizations } from "../../utils/locales";
|
||||
import { Metadata } from "../../utils/metadata";
|
||||
|
@ -84,7 +85,7 @@ export default {
|
|||
if (!member?.voice.channelId) {
|
||||
return await interaction.reply({
|
||||
content: `❌ | ${loc.get("c_play1")}`,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -94,7 +95,7 @@ export default {
|
|||
) {
|
||||
return await interaction.reply({
|
||||
content: `❌ | ${loc.get("c_play2")} ${interaction.guild.members.me.voice.channel}`,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -104,7 +105,7 @@ export default {
|
|||
if (!query) {
|
||||
// Now playing
|
||||
|
||||
const queue = useQueue(interaction.guildId!);
|
||||
const queue = useQueue();
|
||||
|
||||
if (queue) {
|
||||
const track = queue.history.currentTrack;
|
||||
|
@ -142,7 +143,7 @@ export default {
|
|||
queue.delete();
|
||||
return await interaction.reply({
|
||||
content: `❌ | ${loc.get("c_play3")}`,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ export default {
|
|||
const filename = getFilename(__filename);
|
||||
|
||||
const loc = getLocale(client, interaction.locale);
|
||||
const queue = useQueue(interaction.guildId!);
|
||||
const queue = useQueue();
|
||||
|
||||
const embed = new EmbedBuilder();
|
||||
|
||||
|
@ -127,15 +127,15 @@ export default {
|
|||
),
|
||||
);
|
||||
|
||||
const message = await interaction.reply({
|
||||
const callback = await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: rows,
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
|
||||
// Buttons interactions
|
||||
collect(client, interaction, idPrec, message);
|
||||
collect(client, interaction, idNext, message);
|
||||
collect(client, interaction, idPrec, callback.resource!.message!);
|
||||
collect(client, interaction, idNext, callback.resource!.message!);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ export default {
|
|||
const filename = getFilename(__filename);
|
||||
|
||||
const loc = getLocale(client, interaction.locale);
|
||||
const queue = useQueue(interaction.guildId!);
|
||||
const queue = useQueue();
|
||||
|
||||
if (queue) {
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
|
|
|
@ -37,7 +37,7 @@ export default {
|
|||
const filename = getFilename(__filename);
|
||||
|
||||
const loc = getLocale(client, interaction.locale);
|
||||
const queue = useQueue(interaction.guildId!);
|
||||
const queue = useQueue();
|
||||
|
||||
const id = interaction.options.getNumber(loc_default?.get(`c_${filename}_opt1_name`) as string);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { Client, Interaction, InteractionType } from "discord.js";
|
||||
import { Client, Interaction, InteractionType, MessageFlags } from "discord.js";
|
||||
import { getLocale } from "../../utils/locales";
|
||||
import { useMainPlayer } from "discord-player";
|
||||
|
||||
/** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-interactionCreate */
|
||||
export default (interaction: Interaction, client: Client) => {
|
||||
|
@ -10,10 +11,19 @@ export default (interaction: Interaction, client: Client) => {
|
|||
if (!command) {
|
||||
return interaction.reply({
|
||||
content: loc.get("e_interacreate_no_command"),
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
if (interaction.guild) {
|
||||
const player = useMainPlayer();
|
||||
const data = {
|
||||
guild: interaction.guild,
|
||||
};
|
||||
|
||||
return player.context.provide(data, () => command.interaction(interaction, client));
|
||||
}
|
||||
|
||||
return command.interaction(interaction, client);
|
||||
}
|
||||
|
||||
|
@ -22,7 +32,7 @@ export default (interaction: Interaction, client: Client) => {
|
|||
if (!modal) {
|
||||
return interaction.reply({
|
||||
content: loc.get("e_interacreate_no_modal"),
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Client, ModalSubmitInteraction } from "discord.js";
|
||||
import { Client, MessageFlags, ModalSubmitInteraction } from "discord.js";
|
||||
import { getFilename } from "../../utils/misc";
|
||||
import { newReminder } from "../../utils/commands/reminder";
|
||||
|
||||
|
@ -19,7 +19,7 @@ export default {
|
|||
}).then((msg) =>
|
||||
interaction.reply({
|
||||
content: msg as string,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
}),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -7,6 +7,7 @@ import { loadLocales } from "./locales";
|
|||
import { YoutubeiExtractor } from "discord-player-youtubei";
|
||||
import { readSQL } from "./db";
|
||||
import { isDev } from "./misc";
|
||||
import { DefaultExtractors } from "@discord-player/extractor";
|
||||
|
||||
/** Creation of the client and definition of its properties */
|
||||
export default async () => {
|
||||
|
@ -46,14 +47,9 @@ export default async () => {
|
|||
list: new Collection(),
|
||||
};
|
||||
|
||||
const player = Player.singleton(client, {
|
||||
skipFFmpeg: true,
|
||||
ytdlOptions: {
|
||||
filter: "audioonly",
|
||||
quality: "highestaudio",
|
||||
},
|
||||
});
|
||||
await player.extractors.loadDefault((ext) => ext !== "YouTubeExtractor");
|
||||
const player = new Player(client, { skipFFmpeg: true });
|
||||
|
||||
await player.extractors.loadMulti(DefaultExtractors);
|
||||
await player.extractors.register(YoutubeiExtractor, {});
|
||||
|
||||
console.log("Translations progression :");
|
||||
|
|
Loading…
Reference in a new issue