From b11f9996749977a16e516523af7a8e2a9e6521ae Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Sat, 19 Feb 2022 13:21:44 -0600 Subject: [PATCH] feat(sern.ts): changing text-based command parser fn value to string[] Keeping the type of args for fn parse as a string[] should allow users more flexibility --- src/handler/sern.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/handler/sern.ts b/src/handler/sern.ts index e049507a..dd304872 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -128,8 +128,8 @@ export class Handler { message: Some(message), interaction: None, }; - const args = message.content.slice(this.prefix.length).trim().split(/s+/g).join(' '); - const parsedArgs = module.mod.parse?.(context, ['text', args]) ?? Ok(''); + const args = message.content.slice(this.prefix.length).trim().split(/s+/g); + const parsedArgs = module.mod.parse?.(context, ['text', args.join(' ')]) ?? Ok(args); if (parsedArgs.err) return parsedArgs.val; return (await module.mod.execute?.(context, parsedArgs) as possibleOutput | undefined); }