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
This commit is contained in:
Jacob Nguyen
2022-02-19 13:21:44 -06:00
parent b19a41ddf0
commit b11f999674

View File

@@ -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);
}