Skip to content

Commit 026bb1a

Browse files
committed
ci(build): make dynamic imports extension-agnostic and correct plugins path; tidy server config
1 parent 0125a57 commit 026bb1a

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/ButtonInteractions/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default async (button: ButtonInteraction) => {
1919
}
2020
(
2121
new (
22-
await import(`./${button.customId}.js`)
22+
await import(`./${button.customId}`)
2323
).default() as InteractionHandler
2424
).execute(button);
2525
};

src/api/test-utils/server.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@ const getPlugins = async (): Promise<Hapi.Plugin<unknown>[]> => {
66
const files = await fs.readdir('./plugins');
77
for await (const file of files) {
88
if (file.endsWith('.js') || file.endsWith('.ts')) {
9-
const plugin = (await import(`./plugins/${file}`)).default;
9+
const plugin = (await import(`../plugins/${file}`)).default;
1010
plugins.push(plugin);
1111
}
1212
}
1313
console.log(plugins);
1414
return plugins;
1515
};
1616

17-
const server: Hapi.Server = Hapi.server({
18-
port: 3000,
19-
host: 'localhost',
20-
});
17+
const server: Hapi.Server = Hapi.server({ port: 3000, host: 'localhost' });
2118

2219
export async function init() {
2320
await server.initialize();

0 commit comments

Comments
 (0)