fixonwindows

This commit is contained in:
Jacob Nguyen
2025-02-02 19:31:30 -06:00
parent 6bb6581b73
commit 9b86063102
3 changed files with 3 additions and 2 deletions

View File

@@ -65,7 +65,7 @@ export const createLookupTable = (options: SernOptionsData[]): Map<string, SernA
const _createLookupTable = (table: Map<string, SernAutocompleteData>, 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);

View File

@@ -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("<parent>", subCommandGroup, subCommand, option.name)
fullPath = path.posix.join("<parent>", subCommandGroup, subCommand, option.name)
const resolvedModule = (lookupTable.get(fullPath)!.command) as Module
payload= { module: resolvedModule , //autocomplete is not a true "module" warning cast!

View File

@@ -34,6 +34,7 @@ describe('functions', () => {
},
];
const table = createLookupTable(options)
console.log(table)
const result = table.get('<parent>/autocomplete')
expect(result == undefined).to.be.false;
expect(result.name).to.be.eq('autocomplete');