From 963dcf02cff3535db63bd4bd537d9490f4e3291a Mon Sep 17 00:00:00 2001 From: MARCROCK22 <57925328+MARCROCK22@users.noreply.github.com> Date: Mon, 13 May 2024 16:05:35 -0400 Subject: [PATCH] fix: argsParser content --- src/client/onmessagecreate.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/client/onmessagecreate.ts b/src/client/onmessagecreate.ts index ece9759..1b6ee5e 100644 --- a/src/client/onmessagecreate.ts +++ b/src/client/onmessagecreate.ts @@ -114,11 +114,12 @@ export async function onMessageCreate( attachments: {}, }; - const args = (self.options?.commands?.argsParser ?? defaultArgsParser)( - content.slice(fullCommandName.length + 1), - command, - message, - ); + let newContent = content; + for (const i of fullCommandName.split(' ')) { + newContent = newContent.slice(newContent.indexOf(i) + i.length); + } + + const args = (self.options?.commands?.argsParser ?? defaultArgsParser)(newContent.slice(1), command, message); const { options, errors } = await parseOptions(self, command, rawMessage, args, resolved); const optionsResolver = new OptionResolver(self, options, parent as Command, message.guildId, resolved); const context = new CommandContext(self, message, optionsResolver, shardId, command);