diff --git a/packages/botkit/src/core.ts b/packages/botkit/src/core.ts index 10adfd4bf..20309e47c 100644 --- a/packages/botkit/src/core.ts +++ b/packages/botkit/src/core.ts @@ -1123,10 +1123,13 @@ export class Botkit { * ``` * * @param p {string} path to a folder of module files + * @param exts {string[]} the extensions that you would like to load (default: ['.js']) */ - public loadModules(p: string): void { - // load all the .js files from this path - fs.readdirSync(p).filter((f) => { return (path.extname(f) === '.js'); }).forEach((file) => { + public loadModules(p: string, exts: string[] = ['.js']): void { + // load all the .js|.ts files from this path + fs.readdirSync(p).filter((f) => { + return exts.includes(path.extname(f)); + }).forEach((file) => { this.loadModule(path.join(p, file)); }); }