mirror of
https://github.com/sern-handler/handler
synced 2026-06-26 09:42:15 +00:00
fixonwindows
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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!
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user