mirror of
https://github.com/kou029w/daraz-san.git
synced 2025-01-18 16:08:06 +00:00
16 lines
446 B
JavaScript
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;
|