1
0
Fork 0

Fixed command not loading prefix

refactor/models
Bsian 2019-10-28 21:29:06 +00:00
parent 51a70f84ff
commit 1a5e72f94f
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
3 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
import { Message, PrivateChannel } from 'eris';
import uuid from 'uuid/v4';
import { Client, config } from '..';
import { Client } from '..';
import { Command, RichEmbed } from '../class';
export default class CreateAccount extends Command {
@ -8,7 +8,7 @@ export default class CreateAccount extends Command {
super(client);
this.name = 'createaccount';
this.description = 'Create an account on the Cloud VM';
this.usage = `${config.prefix}createaccount [User ID] [Email] [Account name]`;
this.usage = `${this.client.config.prefix}createaccount [User ID] [Email] [Account name]`;
this.aliases = ['createacc', 'cacc', 'caccount', 'create'];
this.permissions = { roles: ['475817826251440128', '525441307037007902'] };
this.enabled = true;

View File

@ -4,14 +4,14 @@ import x509 from '@ghaiklor/x509';
import { Message } from 'eris';
import { AccountInterface } from '../models';
import { Command, RichEmbed } from '../class';
import { Client, config } from '..';
import { Client } from '..';
export default class CWG extends Command {
constructor(client: Client) {
super(client);
this.name = 'cwg';
this.description = 'Manages aspects for the CWG.';
this.usage = `${config.prefix}cwg [User ID/Username] [Domain] [Port] <Path to x509 certificate> <Path to x509 key>`;
this.usage = `${this.client.config.prefix}cwg [User ID/Username] [Domain] [Port] <Path to x509 certificate> <Path to x509 key>`;
this.permissions = { roles: ['525441307037007902'] };
this.enabled = true;
}
@ -99,7 +99,7 @@ export default class CWG extends Command {
cfg = cfg.replace(/\[PORT]/g, String(port));
cfg = cfg.replace(/\[CERTIFICATE]/g, x509Certificate.cert);
cfg = cfg.replace(/\[KEY]/g, x509Certificate.key);
await fs.writeFile(`/etc/nginx/sites-available/${domain}`, config, { encoding: 'utf8' });
await fs.writeFile(`/etc/nginx/sites-available/${domain}`, cfg, { encoding: 'utf8' });
await fs.symlink(`/etc/nginx/sites-available/${domain}`, `/etc/nginx/sites-enabled/${domain}`);
const entry = new this.client.db.Domain({
account,

View File

@ -1,14 +1,14 @@
import { Message, PrivateChannel } from 'eris';
import uuid from 'uuid/v4';
import { Command, RichEmbed } from '../class';
import { Client, config } from '..';
import { Client } from '..';
export default class DeleteAccount extends Command {
constructor(client: Client) {
super(client);
this.name = 'deleteaccount';
this.description = 'Delete an account on the Cloud VM';
this.usage = `${config.prefix}deleteaccount [User ID] [Reason] | ${config.prefix}deleteaccount [Username] [Reason] | ${config.prefix}deleteaccount [Email] [Reason]`;
this.usage = `${this.client.config.prefix}deleteaccount [User ID] [Reason] | ${this.client.config.prefix}deleteaccount [Username] [Reason] | ${this.client.config.prefix}deleteaccount [Email] [Reason]`;
this.aliases = ['deleteacc', 'dacc', 'daccount', 'delete'];
this.permissions = { roles: ['475817826251440128', '525441307037007902'] };
this.enabled = true;