1
0
Fork 0
mirror of https://github.com/kou029w/daraz-san.git synced 2025-01-18 16:08:06 +00:00
daraz-san/app.js
2020-07-21 21:45:28 +09:00

16 lines
446 B
JavaScript

const { App: BoltApp } = require("@slack/bolt");
class App extends BoltApp {
/**
* @param {import("@slack/bolt").AppOptions} opt
*/
constructor(opt) {
super(opt);
const scripts = require("glob").sync("./scripts/*.js").map(require);
scripts.forEach((script) => {
if (Array.isArray(script)) return this.message(...script);
if (script instanceof Function) return script(this);
});
}
}
module.exports = App;