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

17 lines
446 B
JavaScript
Raw Permalink Normal View History

2020-07-21 21:00:35 +09:00
const { App: BoltApp } = require("@slack/bolt");
2019-07-27 01:30:19 +09:00
2020-07-21 21:00:35 +09:00
class App extends BoltApp {
2020-07-17 20:07:32 +09:00
/**
2020-07-21 21:00:35 +09:00
* @param {import("@slack/bolt").AppOptions} opt
2020-07-17 20:07:32 +09:00
*/
2020-07-21 21:00:35 +09:00
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);
});
2020-07-17 20:07:32 +09:00
}
}
2020-07-21 21:00:35 +09:00
module.exports = App;