1
0
Fork 0
refactor/models
Matthew 2020-12-18 19:24:08 -05:00
parent 31705f0b70
commit 8c32801592
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
12 changed files with 16 additions and 15 deletions

View File

@ -7,8 +7,6 @@ import { promises as fs } from 'fs';
import { Client, Collection, Context } from '.';
import type { TCPHandler } from '.';
import * as handlerFiles from '../cscli/handlers';
export default class CSCLI {
public client: Client;
@ -34,7 +32,7 @@ export default class CSCLI {
this.init();
}
public load() {
public load(handlerFiles: { [s: string]: typeof TCPHandler; } | ArrayLike<typeof TCPHandler>) {
const hdFiles = Object.values<typeof TCPHandler>(handlerFiles);
for (const Handler of hdFiles) {
const handler = new Handler();

View File

@ -8,6 +8,8 @@ import { Account, AccountInterface, Moderation, ModerationInterface, Domain, Dom
import { emojis } from '../stores';
import { Command, CSCLI, Util, Collection, Server, Event } from '.';
import * as handlerFiles from '../cscli';
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; };
@ -139,7 +141,8 @@ export default class Client extends Eris.Client {
});
this.server = new Server(this, { port: this.config.port });
// eslint-disable-next-line no-new
new CSCLI(this);
const cscli = new CSCLI(this);
cscli.load(handlerFiles);
const corepath = '/opt/CloudServices/dist';
const cmdFiles = await fs.readdir('/opt/CloudServices/dist/commands');

View File

@ -1,4 +1,4 @@
import { TCPHandler, Context } from '../../class';
import { TCPHandler, Context } from '../class';
export default class KillPID extends TCPHandler {
constructor() {

View File

@ -1,4 +1,4 @@
import { TCPHandler, Context } from '../../class';
import { TCPHandler, Context } from '../class';
export default class Lock extends TCPHandler {
constructor() {

View File

@ -1,4 +1,4 @@
import { TCPHandler, Context } from '../../class';
import { TCPHandler, Context } from '../class';
export default class ProcessCount extends TCPHandler {
constructor() {

View File

@ -1,5 +1,5 @@
import { TCPHandler, Context } from '../../class';
import { dataConversion } from '../../functions';
import { TCPHandler, Context } from '../class';
import { dataConversion } from '../functions';
export default class RAM extends TCPHandler {
constructor() {

View File

@ -1,4 +1,4 @@
import { TCPHandler, Context } from '../../class';
import { TCPHandler, Context } from '../class';
export default class RAMLimits extends TCPHandler {
constructor() {

View File

@ -1,4 +1,4 @@
import { TCPHandler, Context, Report } from '../../class';
import { TCPHandler, Context, Report } from '../class';
export default class Score extends TCPHandler {
constructor() {

View File

@ -1,4 +1,4 @@
import { TCPHandler, Context } from '../../class';
import { TCPHandler, Context } from '../class';
export default class SSHLogins extends TCPHandler {
constructor() {

View File

@ -1,5 +1,5 @@
import { TCPHandler, Context } from '../../class';
import { dataConversion } from '../../functions';
import { TCPHandler, Context } from '../class';
import { dataConversion } from '../functions';
export default class Storage extends TCPHandler {
constructor() {

View File

@ -1,4 +1,4 @@
import { TCPHandler, Context } from '../../class';
import { TCPHandler, Context } from '../class';
export default class UserInfo extends TCPHandler {
constructor() {