From 9b8606310275f25699e06a068642154ff919e87e Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Sun, 2 Feb 2025 19:31:30 -0600 Subject: [PATCH] fixonwindows --- src/core/functions.ts | 2 +- src/handlers/interaction.ts | 2 +- test/core/functions.test.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/functions.ts b/src/core/functions.ts index 8cf221a..4cf8a00 100644 --- a/src/core/functions.ts +++ b/src/core/functions.ts @@ -65,7 +65,7 @@ export const createLookupTable = (options: SernOptionsData[]): Map, options: SernOptionsData[], parent: string) => { for (const opt of options) { - const name = path.join(parent, opt.name) + const name = path.posix.join(parent, opt.name) switch(opt.type) { case ApplicationCommandOptionType.Subcommand: { _createLookupTable(table, opt.options ?? [], name); diff --git a/src/handlers/interaction.ts b/src/handlers/interaction.ts index 8b77341..e72c1d9 100644 --- a/src/handlers/interaction.ts +++ b/src/handlers/interaction.ts @@ -36,7 +36,7 @@ export function interactionHandler(deps: UnpackedDependencies, defaultPrefix?: s const subCommandGroup = event.options.getSubcommandGroup() ?? "", subCommand = event.options.getSubcommand() ?? "", option = event.options.getFocused(true), - fullPath = path.join("", subCommandGroup, subCommand, option.name) + fullPath = path.posix.join("", subCommandGroup, subCommand, option.name) const resolvedModule = (lookupTable.get(fullPath)!.command) as Module payload= { module: resolvedModule , //autocomplete is not a true "module" warning cast! diff --git a/test/core/functions.test.ts b/test/core/functions.test.ts index beb402e..4e93655 100644 --- a/test/core/functions.test.ts +++ b/test/core/functions.test.ts @@ -34,6 +34,7 @@ describe('functions', () => { }, ]; const table = createLookupTable(options) + console.log(table) const result = table.get('/autocomplete') expect(result == undefined).to.be.false; expect(result.name).to.be.eq('autocomplete');