mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 04:56:07 +00:00
fix: slice message content argsParser
This commit is contained in:
parent
6a63178846
commit
b44e7d456a
@ -219,7 +219,7 @@ export interface ClientOptions extends BaseClientOptions {
|
||||
prefix?: (message: Message) => Promise<string[]> | string[];
|
||||
deferReplyResponse?: (ctx: CommandContext) => Parameters<Message['write']>[0];
|
||||
reply?: (ctx: CommandContext) => boolean;
|
||||
argsParser?: (content: string, command: SubCommand | Command) => Record<string, string>;
|
||||
argsParser?: (content: string, command: SubCommand | Command, message: Message) => Record<string, string>;
|
||||
};
|
||||
handlePayload?: ShardManagerOptions['handlePayload'];
|
||||
}
|
||||
|
@ -113,7 +113,12 @@ export async function onMessageCreate(
|
||||
members: {},
|
||||
attachments: {},
|
||||
};
|
||||
const args = (self.options?.commands?.argsParser ?? defaultArgsParser)(content, command);
|
||||
|
||||
const args = (self.options?.commands?.argsParser ?? defaultArgsParser)(
|
||||
content.slice(fullCommandName.length + 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user