1
0
Fork 0
refactor/models
Matthew 2020-12-18 19:26:28 -05:00
parent 8c32801592
commit 76e189cbc9
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
2 changed files with 4 additions and 5 deletions

View File

@ -8,8 +8,6 @@ import { Account, AccountInterface, Moderation, ModerationInterface, Domain, Dom
import { emojis } from '../stores'; import { emojis } from '../stores';
import { Command, CSCLI, Util, Collection, Server, Event } from '.'; import { Command, CSCLI, Util, Collection, Server, Event } from '.';
import * as handlerFiles from '../cscli';
export default class Client extends Eris.Client { export default class Client extends Eris.Client {
public config: { 'token': string; 'cloudflare': string; 'prefix': string; 'emailPass': string; 'mongoURL': string; 'port': number; 'keyPair': { 'publicKey': string; 'privateKey': string; }; vendorKey: string; internalKey: string; }; public config: { 'token': string; 'cloudflare': string; 'prefix': string; 'emailPass': string; 'mongoURL': string; 'port': number; 'keyPair': { 'publicKey': string; 'privateKey': string; }; vendorKey: string; internalKey: string; };
@ -141,8 +139,6 @@ export default class Client extends Eris.Client {
}); });
this.server = new Server(this, { port: this.config.port }); this.server = new Server(this, { port: this.config.port });
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
const cscli = new CSCLI(this);
cscli.load(handlerFiles);
const corepath = '/opt/CloudServices/dist'; const corepath = '/opt/CloudServices/dist';
const cmdFiles = await fs.readdir('/opt/CloudServices/dist/commands'); const cmdFiles = await fs.readdir('/opt/CloudServices/dist/commands');

View File

@ -1,6 +1,7 @@
import { Client } from './class'; import { Client, CSCLI } from './class';
import * as eventFiles from './events'; import * as eventFiles from './events';
import * as commandFiles from './commands'; import * as commandFiles from './commands';
import * as handlerFiles from './cscli';
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
async function main() { async function main() {
@ -9,6 +10,8 @@ async function main() {
await client.loadEvents(eventFiles); await client.loadEvents(eventFiles);
await client.loadFunctions(); await client.loadFunctions();
await client.init(); await client.init();
const cscli = new CSCLI(client);
cscli.load(handlerFiles);
} }
main(); main();