forked from engineering/cloudservices
fixes
parent
31705f0b70
commit
8c32801592
|
@ -7,8 +7,6 @@ import { promises as fs } from 'fs';
|
||||||
import { Client, Collection, Context } from '.';
|
import { Client, Collection, Context } from '.';
|
||||||
import type { TCPHandler } from '.';
|
import type { TCPHandler } from '.';
|
||||||
|
|
||||||
import * as handlerFiles from '../cscli/handlers';
|
|
||||||
|
|
||||||
export default class CSCLI {
|
export default class CSCLI {
|
||||||
public client: Client;
|
public client: Client;
|
||||||
|
|
||||||
|
@ -34,7 +32,7 @@ export default class CSCLI {
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public load() {
|
public load(handlerFiles: { [s: string]: typeof TCPHandler; } | ArrayLike<typeof TCPHandler>) {
|
||||||
const hdFiles = Object.values<typeof TCPHandler>(handlerFiles);
|
const hdFiles = Object.values<typeof TCPHandler>(handlerFiles);
|
||||||
for (const Handler of hdFiles) {
|
for (const Handler of hdFiles) {
|
||||||
const handler = new Handler();
|
const handler = new Handler();
|
||||||
|
|
|
@ -8,6 +8,8 @@ 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; };
|
||||||
|
@ -139,7 +141,8 @@ 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
|
||||||
new CSCLI(this);
|
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');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { TCPHandler, Context } from '../../class';
|
import { TCPHandler, Context } from '../class';
|
||||||
|
|
||||||
export default class KillPID extends TCPHandler {
|
export default class KillPID extends TCPHandler {
|
||||||
constructor() {
|
constructor() {
|
|
@ -1,4 +1,4 @@
|
||||||
import { TCPHandler, Context } from '../../class';
|
import { TCPHandler, Context } from '../class';
|
||||||
|
|
||||||
export default class Lock extends TCPHandler {
|
export default class Lock extends TCPHandler {
|
||||||
constructor() {
|
constructor() {
|
|
@ -1,4 +1,4 @@
|
||||||
import { TCPHandler, Context } from '../../class';
|
import { TCPHandler, Context } from '../class';
|
||||||
|
|
||||||
export default class ProcessCount extends TCPHandler {
|
export default class ProcessCount extends TCPHandler {
|
||||||
constructor() {
|
constructor() {
|
|
@ -1,5 +1,5 @@
|
||||||
import { TCPHandler, Context } from '../../class';
|
import { TCPHandler, Context } from '../class';
|
||||||
import { dataConversion } from '../../functions';
|
import { dataConversion } from '../functions';
|
||||||
|
|
||||||
export default class RAM extends TCPHandler {
|
export default class RAM extends TCPHandler {
|
||||||
constructor() {
|
constructor() {
|
|
@ -1,4 +1,4 @@
|
||||||
import { TCPHandler, Context } from '../../class';
|
import { TCPHandler, Context } from '../class';
|
||||||
|
|
||||||
export default class RAMLimits extends TCPHandler {
|
export default class RAMLimits extends TCPHandler {
|
||||||
constructor() {
|
constructor() {
|
|
@ -1,4 +1,4 @@
|
||||||
import { TCPHandler, Context, Report } from '../../class';
|
import { TCPHandler, Context, Report } from '../class';
|
||||||
|
|
||||||
export default class Score extends TCPHandler {
|
export default class Score extends TCPHandler {
|
||||||
constructor() {
|
constructor() {
|
|
@ -1,4 +1,4 @@
|
||||||
import { TCPHandler, Context } from '../../class';
|
import { TCPHandler, Context } from '../class';
|
||||||
|
|
||||||
export default class SSHLogins extends TCPHandler {
|
export default class SSHLogins extends TCPHandler {
|
||||||
constructor() {
|
constructor() {
|
|
@ -1,5 +1,5 @@
|
||||||
import { TCPHandler, Context } from '../../class';
|
import { TCPHandler, Context } from '../class';
|
||||||
import { dataConversion } from '../../functions';
|
import { dataConversion } from '../functions';
|
||||||
|
|
||||||
export default class Storage extends TCPHandler {
|
export default class Storage extends TCPHandler {
|
||||||
constructor() {
|
constructor() {
|
|
@ -1,4 +1,4 @@
|
||||||
import { TCPHandler, Context } from '../../class';
|
import { TCPHandler, Context } from '../class';
|
||||||
|
|
||||||
export default class UserInfo extends TCPHandler {
|
export default class UserInfo extends TCPHandler {
|
||||||
constructor() {
|
constructor() {
|
Loading…
Reference in New Issue