forked from engineering/cloudservices
bind new util and new load functions func
parent
38f48bb324
commit
70c7e3f698
|
@ -3,10 +3,10 @@ import mongoose from 'mongoose';
|
||||||
import signale from 'signale';
|
import signale from 'signale';
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { config, Util } from '.';
|
import { config } from '.';
|
||||||
import { Account, AccountInterface, Moderation, ModerationInterface, Domain, DomainInterface } from './models';
|
import { Account, AccountInterface, Moderation, ModerationInterface, Domain, DomainInterface } from './models';
|
||||||
import { emojis } from './stores';
|
import { emojis } from './stores';
|
||||||
import { Command } from './class';
|
import { Command, Util } from './class';
|
||||||
|
|
||||||
|
|
||||||
export default class Client extends Eris.Client {
|
export default class Client extends Eris.Client {
|
||||||
|
@ -39,6 +39,19 @@ export default class Client extends Eris.Client {
|
||||||
displayTimestamp: true,
|
displayTimestamp: true,
|
||||||
displayFilename: true,
|
displayFilename: true,
|
||||||
});
|
});
|
||||||
|
this.loadFunctions();
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async loadFunctions() {
|
||||||
|
const functions = await fs.readdir('./functions');
|
||||||
|
functions.forEach(async (func) => {
|
||||||
|
try {
|
||||||
|
require(`./functions/${func}`).default(this);
|
||||||
|
} catch (error) {
|
||||||
|
await this.util.handleError(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public loadCommand(commandPath: string) {
|
public loadCommand(commandPath: string) {
|
||||||
|
|
Loading…
Reference in New Issue