forked from engineering/cloudservices
Fix args
parent
fae3486148
commit
8cad4a87db
|
@ -19,7 +19,7 @@ export default class Eval extends Command {
|
||||||
public async run(message: Message, args: string[]) {
|
public async run(message: Message, args: string[]) {
|
||||||
try {
|
try {
|
||||||
// const evalMessage = message.content.slice(this.client.config.prefix.length).split(' ').slice(1).join(' ');
|
// const evalMessage = message.content.slice(this.client.config.prefix.length).split(' ').slice(1).join(' ');
|
||||||
let evalString = args.join(' ').trim();
|
let evalString: string;
|
||||||
let evaled: any;
|
let evaled: any;
|
||||||
let depth = 0;
|
let depth = 0;
|
||||||
|
|
||||||
|
@ -27,10 +27,11 @@ export default class Eval extends Command {
|
||||||
depth = Number(args[0].replace('-d', ''));
|
depth = Number(args[0].replace('-d', ''));
|
||||||
if (!depth || depth < 0) depth = 0;
|
if (!depth || depth < 0) depth = 0;
|
||||||
args.shift();
|
args.shift();
|
||||||
|
evalString = args.join(' ').trim();
|
||||||
}
|
}
|
||||||
if (args[0] === '-a' || args[0] === '-async') {
|
if (args[0] === '-a' || args[0] === '-async') {
|
||||||
args.shift();
|
args.shift();
|
||||||
evalString = `(async () => { ${evalString} })()`;
|
evalString = `(async () => { ${args.join(' ').trim()} })()`;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue