Skip to content

Commit

Permalink
feat(sern.ts): changing text-based command parser fn value to string[]
Browse files Browse the repository at this point in the history
Keeping the type of args for fn parse as a string[] should allow users more flexibility
  • Loading branch information
jacoobes committed Feb 19, 2022
1 parent b19a41d commit b11f999
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/handler/sern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b11f999

Please sign in to comment.