From 30fe586e6657a527660ec2beac5928df764725f9 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 17 Sep 2024 19:02:18 +0200 Subject: [PATCH 1/4] provide debugging information when developping --- src/index.ts | 6 ++++-- src/load.ts | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 002ac0c..835ce0b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,12 @@ +const isDev = process.env.NODE_ENV !== "production"; + /** Load the app */ const start_app = () => { - import("./load").then((l) => l.run().catch((error) => console.error(error))); + import("./load").then((l) => l.run(isDev).catch((error) => console.error(error))); }; // Load .env if not in prod -if (process.env.NODE_ENV !== "production") { +if (isDev) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import("dotenv").then((c) => { diff --git a/src/load.ts b/src/load.ts index 560e4a7..8c56413 100644 --- a/src/load.ts +++ b/src/load.ts @@ -7,13 +7,18 @@ import loadClient, { quit } from "./utils/client"; import { logStart } from "./utils/misc"; /** Run the bot */ -export const run = async () => { +export const run = async (isDev: boolean) => { console.log("Starting Botanique..."); // Client Discord.JS const client_name = "Client"; await loadClient() .then(async (client) => { + if (isDev) { + // Attach debugging listeners + client.on("debug", console.log).on("warn", console.warn); + } + // Events Discord.JS and Player const events_name = "Events"; await loadEvents(client) -- 2.45.2 From ee37e12b6595373acc1b1142be44b32b7e6e09f8 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 17 Sep 2024 19:18:08 +0200 Subject: [PATCH 2/4] typos --- src/locales/fr.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/locales/fr.json b/src/locales/fr.json index f17ecf8..9354717 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -2,17 +2,17 @@ "e_interacreate_no_command": "Désolé, la commande n'existe plus...", "e_interacreate_no_modal": "Désolé, le modèle n'existe plus...", "e_interacreate_no_button": "Désolé, le bouton n'existe plus...", - "e_interacreate_no_autocomplete": "Désolé, pas d'autocomplétion existe pour cette commande...", + "e_interacreate_no_autocomplete": "Désolé, pas d'autocomplétion n'existe pour cette commande...", "c_ping_name": "Ping", "c_ping_desc": "Pong!", "c_ping1": "Latence totale", - "c_ping2": "Latence du Websocket", + "c_ping2": "Latence du Web socket", "c_help_name": "Aide", "c_help_desc": "Informations sur les commandes", "c_help_opt1_name": "commande", - "c_help_opt1_desc": "Commande voulu en détail", + "c_help_opt1_desc": "Commande voulue en détail", "c_help1": "Liste des catégories et des commandes associées", "c_help2": "`/help ` pour obtenir plus d'informations sur une commande.", "c_help3": "Impossible de trouver :", @@ -21,7 +21,7 @@ "c_archive_desc": "Nettoyage pour le passage à niveau", "c_archive_opt1_name": "catégorie", "c_archive_opt1_desc": "Nom de la catégorie à nettoyer", - "c_archive1": "Liste des catégories soumis au nettoyage", + "c_archive1": "Liste des catégories soumises au nettoyage", "c_archive2": "`L1`, `L2`, `L3`, `M1`, `M2`", "c_archive3": "Impossible de trouver/nettoyer le salon :", "c_archive4": "Liste des salons archivés de la catégorie", @@ -33,10 +33,10 @@ "c_prep_desc": "Préparation des salons généraux pour la nouvelle année", "c_prep_opt1_name": "année", "c_prep_opt1_desc": "Nom de l'année à préparer", - "c_prep1": "Liste des catégories soumis à la préparation", + "c_prep1": "Liste des catégories soumises à la préparation", "c_prep2": "`L1`, `L2`, `L3`, `M1`, `M2`", "c_prep3": "Impossible de trouver/nettoyer le salon :", - "c_prep4": "Listes des Salons préparés `", + "c_prep4": "Listes des salons préparés `", "c_prep5": "créé", "c_prep6": "Pas besoin de préparation", @@ -45,11 +45,11 @@ "c_reminder_name": "rappel", "c_reminder_desc": "Commande relative aux rappels", "c_reminder_sub1_name": "nouveau", - "c_reminder_sub1_desc": "Met en place un rappel", + "c_reminder_sub1_desc": "Mets en place un rappel", "c_reminder_sub1_opt1_name": "temps", "c_reminder_sub1_opt1_desc": "Temps désiré avant le rappel, accolez un @ pour activer la mention ou un p pour envoyer en DM", "c_reminder_sub1_opt2_name": "message", - "c_reminder_sub1_opt2_desc": "Message du rappel", + "c_reminder_sub1_opt2_desc": "Message de rappel", "c_reminder_sub2_name": "liste", "c_reminder_sub2_desc": "Affiche la liste des rappels d'un utilisateur", "c_reminder_sub2_opt1_name": "utilisateur", @@ -114,7 +114,7 @@ "c_queue_sub3_name": "retire", "c_queue_sub3_desc": "Retire une chanson de la file d'attente", "c_queue_sub3_opt1_name": "id", - "c_queue_sub3_opt1_desc": "ID de la chanson a retirer", + "c_queue_sub3_opt1_desc": "ID de la chanson à retirer", "c_queue1": "File d'attente", "c_queue2": "La liste est vide.", "c_queue3": "Liste d'attente mélangée", @@ -140,9 +140,9 @@ "c_lyrics_sub1_name": "normal", "c_lyrics_sub1_desc": "Recherche de paroles", "c_lyrics_sub2_name": "romanized", - "c_lyrics_sub2_desc": "Recherche de paroles romanisée (ex: hangul -> latin)", + "c_lyrics_sub2_desc": "Recherche de paroles romanisées (ex: hangul → latin)", "c_lyrics_sub3_name": "synced", - "c_lyrics_sub3_desc": "Recherche de paroles synchronisée (se met à jour avec la chanson en direct)", + "c_lyrics_sub3_desc": "Recherche de paroles synchronisées (se mettent à jour avec la chanson en direct)", "c_lyrics_opt1_name": "chanson", "c_lyrics_opt1_desc": "Chanson recherchée", "c_lyrics1": "Le bot ne joue rien en ce moment et aucune chanson n'est renseignée.", @@ -161,7 +161,7 @@ "c_repeat_sub4_name": "autoplay", "c_repeat_sub4_desc": "Active la lecture automatique", "c_repeat1": "Le bot ne joue rien en ce moment.", - "c_repeat2": "Répétition désactivé", + "c_repeat2": "Répétition désactivée", "c_repeat3": "Répétition de la file d'attente", "c_repeat4": "Lecture automatique", "c_repeat5": "Répétition de la chanson", -- 2.45.2 From cecf86014ee2cc9f7bbe8516720b44820afbe31a Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 17 Sep 2024 19:32:14 +0200 Subject: [PATCH 3/4] complete en-US translation --- src/locales/en-US.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 69a1a9b..2b97e29 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -2,6 +2,7 @@ "e_interacreate_no_command": "Sorry, the command probably no longer exists...", "e_interacreate_no_modal": "Sorry, the model no longer exists...", "e_interacreate_no_button": "Sorry, the button no longer exists...", + "e_interacreate_no_autocomplete": "Sorry, no autocomplete is available for this command...", "c_ping_name": "Ping", "c_ping_desc": "Pong!", @@ -88,6 +89,8 @@ "c_play5": "added to the queue", "c_play6": "The bot is not playing anything right now.", "c_play7": "Currently playing", + "c_play8": "Asked by", + "c_play9": "No results were found", "c_stop_name": "stop", "c_stop_desc": "Stop the music", @@ -134,6 +137,10 @@ "c_lyrics_name": "lyrics", "c_lyrics_desc": "Displays the lyrics of a song", + "c_lyrics_sub1_name": "normal", + "c_lyrics_sub1_desc": "Lyrics search", + "c_lyrics_sub2_name": "romanized", + "c_lyrics_sub2_desc": "Search for romanized lyrics (e.g., hangul → Latin)", "c_lyrics_sub3_name": "synced", "c_lyrics_sub3_desc": "Synchronized lyrics search (updates in live)", "c_lyrics_opt1_name": "song", @@ -158,5 +165,8 @@ "c_repeat3": "Repeating the queue", "c_repeat4": "Automatic playback", "c_repeat5": "Repeating the song", - "c_repeat6": "enabled" + "c_repeat6": "enabled", + + "e_trackstart1": "Asked by", + "e_trackstart2": "Duration :" } -- 2.45.2 From 144635bd764dc2d17f61f6dec91cc1180b380f62 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 17 Sep 2024 19:32:25 +0200 Subject: [PATCH 4/4] fix us typos --- src/locales/en-US.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 2b97e29..807ac06 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -1,16 +1,16 @@ { "e_interacreate_no_command": "Sorry, the command probably no longer exists...", - "e_interacreate_no_modal": "Sorry, the model no longer exists...", + "e_interacreate_no_modal": "Sorry, the template no longer exists...", "e_interacreate_no_button": "Sorry, the button no longer exists...", "e_interacreate_no_autocomplete": "Sorry, no autocomplete is available for this command...", "c_ping_name": "Ping", "c_ping_desc": "Pong!", "c_ping1": "Roundtrip latency", - "c_ping2": "Websocket heartbeat", + "c_ping2": "Web socket heartbeat", "c_help_name": "Help", - "c_help_desc": "Informations about commands", + "c_help_desc": "Information about commands", "c_help_opt1_name": "command", "c_help_opt1_desc": "Command wanted in depth.", "c_help1": "List of categories and associated commands", @@ -18,7 +18,7 @@ "c_help3": "Can't find :", "c_archive_name": "clean", - "c_archive_desc": "Clean category for new year", + "c_archive_desc": "Clean category for the new year", "c_archive_opt1_name": "category", "c_archive_opt1_desc": "Name of the category to be cleaned", "c_archive1": "List of categories subject to cleaning", @@ -38,7 +38,7 @@ "c_prep3": "Unable to find/clean the channel:", "c_prep4": "Lists of prepared channels `", "c_prep5": "created", - "c_prep6": "No preparation required", + "c_prep6": "No preparation is required", "u_time_at": "at", @@ -47,11 +47,11 @@ "c_reminder_sub1_name": "new", "c_reminder_sub1_desc": "Sets up a reminder", "c_reminder_sub1_opt1_name": "time", - "c_reminder_sub1_opt1_desc": "Desired time before the reminder, append an @ to activate the mention or a p to send in DM", + "c_reminder_sub1_opt1_desc": "Desired time before the reminder, append an @ to activate the mention or a p to send in a DM", "c_reminder_sub1_opt2_name": "message", "c_reminder_sub1_opt2_desc": "Reminder message", "c_reminder_sub2_name": "list", - "c_reminder_sub2_desc": "Displays the list of reminders of a user", + "c_reminder_sub2_desc": "Displays the list of reminders for a user", "c_reminder_sub2_opt1_name": "user", "c_reminder_sub2_opt1_desc": "Displays the list of this user", "c_reminder_sub2_opt2_name": "page", @@ -62,7 +62,7 @@ "c_reminder_sub3_opt1_desc": "Reminder to be deleted", "c_reminder1": "A reminder has been set up for in", "c_reminder2": "The ID entered is not valid.", - "c_reminder3": "Reminder not found, not on the right guild or not belonging to you.", + "c_reminder3": "Reminder not found, not in the right guild, or not belonging to you.", "c_reminder4": "Unknown user.", "c_reminder5": "Reminders of", "c_reminder6": "Page", @@ -82,7 +82,7 @@ "c_play_desc": "Plays a song/playlist, no query displays the now playing song", "c_play_opt1_name": "query", "c_play_opt1_desc": "What you want to listen to", - "c_play1": "You're not in any vocal channel.", + "c_play1": "You're not on any vocal channels.", "c_play2": "You are in the wrong voice channel, I am in", "c_play3": "Unable to join the voice channel.", "c_play4": "not found", @@ -145,9 +145,9 @@ "c_lyrics_sub3_desc": "Synchronized lyrics search (updates in live)", "c_lyrics_opt1_name": "song", "c_lyrics_opt1_desc": "Wanted song", - "c_lyrics1": "The bot is not playing anything at the moment and no songs are specified.", + "c_lyrics1": "The bot is not playing anything at the moment, and no songs are specified.", "c_lyrics2": "Unable to find the lyrics for", - "c_lyrics3": "Impossible to find synchronized lyrics for", + "c_lyrics3": "Unable to find synchronized lyrics for", "c_lyrics4": "It's karaoke time!", "c_repeat_name": "repeat", -- 2.45.2