mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user