From adc8b1ac24984eae9126ae4bac1da204eeaeb752 Mon Sep 17 00:00:00 2001 From: arthur Date: Fri, 26 Apr 2024 23:12:24 +0200 Subject: [PATCH] carrige bug si il y a trop de task --- commands/automatisation/viewtasks.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commands/automatisation/viewtasks.ts b/commands/automatisation/viewtasks.ts index d4354ec..b8cf54a 100644 --- a/commands/automatisation/viewtasks.ts +++ b/commands/automatisation/viewtasks.ts @@ -17,7 +17,12 @@ module.exports = { rows.forEach((row: any) => { tasks += `\n- ${row.id} - ${row.name} : ${row.time} minutes`; }); - message.edit(`# Liste des tâches :${tasks}`); + + const tasksChunks = tasks.match(/.{1,2000}/g); + + tasksChunks.forEach((chunk: string) => { + message.edit(`# Liste des tâches :${chunk}`); + }); }); } }; \ No newline at end of file