core: load ts files only

This commit is contained in:
undefined committed 2024-01-07 17:12:59 +08:00
1 parent ac1699665c
commit 5369d8d5eb
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@ export async function apply(ctx: Context) {
const handlerDir = path.resolve(__dirname, '..', 'handler');
const handlers = await fs.readdir(handlerDir);
for (const h of handlers) {
for (const h of handlers.filter((i) => i.endsWith('.ts'))) {
ctx.loader.reloadPlugin(ctx, path.resolve(handlerDir, h), {}, `hydrooj/handler/${h.split('.')[0]}`);
}
await handler(pending, fail, ctx);