mirror of
https://github.com/System-End/slack-end.git
synced 2026-04-19 22:05:10 +00:00
fix: use import + re add sentry
This commit is contained in:
parent
576ff5d0f7
commit
59d09432d3
2 changed files with 4 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import "dotenv/config";
|
||||
// import "./modules/sentry";
|
||||
import "./modules/sentry";
|
||||
import * as Sentry from "@sentry/node";
|
||||
import { Api } from "nocodb-sdk";
|
||||
import init from "./modules/watch-git";
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ export default class CommandLoader {
|
|||
for (const file of files) {
|
||||
const stamp = Date.now();
|
||||
try {
|
||||
const commandClass = require(path.join(this.dir, file));
|
||||
const commandClass = await import(path.join(this.dir, file));
|
||||
console.log(commandClass)
|
||||
cmds.push({ commandClass, file });
|
||||
// const cmd = new commandClass.default();
|
||||
// cmd.run(this._app);
|
||||
|
|
@ -56,7 +57,7 @@ export default class CommandLoader {
|
|||
}
|
||||
for (const { commandClass, file } of cmds) {
|
||||
const stamp = Date.now();
|
||||
const c = new commandClass.default();
|
||||
const c = commandClass.default ? new commandClass.default() : new commandClass();
|
||||
console.log(`Running ${file}`);
|
||||
try {
|
||||
c.run(this._app);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue