From a1a98a06c66bd8e30116353618b8e5287250c187 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Thu, 8 Aug 2024 01:25:56 +0300 Subject: [PATCH] fix: better line training --- src/commands/chat.command.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/commands/chat.command.ts b/src/commands/chat.command.ts index 7ec7bde..44f4ff1 100644 --- a/src/commands/chat.command.ts +++ b/src/commands/chat.command.ts @@ -75,7 +75,12 @@ export default command({ message.reply('You are not allowed to do that!') break } - const lines = args.slice(1).join(' ').split('\n') + const lines = args + .slice(1) + .join(' ') + .split('\n') + .map((x) => x.trim()) + .filter(Boolean) await megahal.train(lines) message.reply('Trained successfully') break