forked from engineering/cloudservices
another fix attempt on eval
parent
baf65952f6
commit
1ed93f3b5f
|
@ -15,14 +15,14 @@ export default class Eval extends Command {
|
||||||
this.permissions = { users: ['253600545972027394', '278620217221971968'] };
|
this.permissions = { users: ['253600545972027394', '278620217221971968'] };
|
||||||
}
|
}
|
||||||
|
|
||||||
public async run(message: Message) {
|
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 evaled: any;
|
let evaled: any;
|
||||||
let output: string;
|
let output: string;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
evaled = await eval(message.content);
|
evaled = await eval(args.join(' ').trim());
|
||||||
if (typeof evaled !== 'string') output = output && inspect(evaled, { depth: 1 });
|
if (typeof evaled !== 'string') output = output && inspect(evaled, { depth: 1 });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
output = error.stack;
|
output = error.stack;
|
||||||
|
|
Loading…
Reference in New Issue