From 2ac611dab7bba8bd7413c9e2659c7499e63f0a5d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 27 Sep 2024 21:21:30 +0200 Subject: [PATCH] fix: docker (#190) Reviewed-on: https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/pulls/190 Co-authored-by: Mylloon Co-committed-by: Mylloon --- .dockerignore | 2 +- Dockerfile | 2 +- src/commands/misc/help.ts | 2 ++ src/commands/music/lyrics.ts | 3 ++- src/commands/music/play.ts | 1 + src/commands/music/queue.ts | 1 + src/events/message/messageCreate.ts | 2 ++ src/utils/time.ts | 3 ++- 8 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index f875840..9cddb1c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,4 +6,4 @@ !LICENSE !tsconfig.json -src/tests +src/tests/ diff --git a/Dockerfile b/Dockerfile index 32f92c3..07d99b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM node:22.8-bullseye-slim +FROM node:22.9-bullseye-slim ENV DOCKERIZED=1 RUN mkdir /config && \ diff --git a/src/commands/misc/help.ts b/src/commands/misc/help.ts index ce9ebac..45e7210 100644 --- a/src/commands/misc/help.ts +++ b/src/commands/misc/help.ts @@ -49,6 +49,7 @@ export default { // Load all the command per categories // TODO: Check if the command exist in the context (guild) // TODO: List subcommands too + // https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/issues/47 client.commands.categories.forEach((commands_name, category) => { const commands = commands_name.reduce((data, command_name) => { return data + `\`/${command_name}\`, `; @@ -74,6 +75,7 @@ export default { // If a command is specified // TODO: Check if the command exist in the context (guild) + // https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/issues/187 const command = client.commands.list.get(desired_command); if (!command) { // Command don't exist diff --git a/src/commands/music/lyrics.ts b/src/commands/music/lyrics.ts index affe0e3..416ff5c 100644 --- a/src/commands/music/lyrics.ts +++ b/src/commands/music/lyrics.ts @@ -152,9 +152,10 @@ export default { const limit_desc = 4096; const nb_embed = Math.ceil(title.plainLyrics.length / limit_desc); + // https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/issues/186 // TODO: If lyrics < 6000, only send one message with multiples embed for (let i = 0, j = 0; i < nb_embed; i++, j += limit_desc) { - // TODO: Better cut in lyrics + // + Better cut in lyrics const lyrics = title.plainLyrics.slice(j, j + limit_desc); let embed; diff --git a/src/commands/music/play.ts b/src/commands/music/play.ts index 0c6311c..95dd2c1 100644 --- a/src/commands/music/play.ts +++ b/src/commands/music/play.ts @@ -178,6 +178,7 @@ export default { // TODO: When added to an existing queue (size of queue > 0): // - Add position in queue // - Add estimated time until playing + // https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/issues/184 return await interaction.followUp({ content: `⏱️ | \`${title}\` ${loc.get("c_play5")}.`, }); diff --git a/src/commands/music/queue.ts b/src/commands/music/queue.ts index 17f26cb..23ab5d6 100644 --- a/src/commands/music/queue.ts +++ b/src/commands/music/queue.ts @@ -72,6 +72,7 @@ export default { // Specified ID // TODO?: ID range -> as a string: 5-8 remove 5, 6, 7, 8 + // https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/issues/185 .addNumberOption((option) => option .setName(loc_default.get(`c_${filename}_sub3_opt1_name`)!.toLowerCase()) diff --git a/src/events/message/messageCreate.ts b/src/events/message/messageCreate.ts index 6ad95ca..ea977cb 100644 --- a/src/events/message/messageCreate.ts +++ b/src/events/message/messageCreate.ts @@ -118,7 +118,9 @@ export default async (message: Message, client: Client) => { quoted_post.attachments.forEach((file) => (files += `[${file.name}](${file.url}), `)); embed.addFields({ // TODO: Don't pluralize when there is only one file. + // TODO: Locales + // https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/issues/188 name: "Fichiers joints", // TODO: Check if don't exceed char limit, if yes, split // files into multiples field. diff --git a/src/utils/time.ts b/src/utils/time.ts index e25d93d..3f02e56 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -100,7 +100,8 @@ export const strToSeconds = (time: string) => { */ export const timeDeltaToString = (time: number) => { const now = Date.now(); - // TODO adapt the output and not always parse the time as seconds + // TODO: adapt the output and not always parse the time as seconds + // https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/issues/189 // Use Intl.RelativeTimeFormat ? return `${strToSeconds(`${(now - time) / 1000}`)} secs`; };