2022-05-05 21:47:08 +01:00
|
|
|
const { StdinCommand } = require('@eartharoid/dbf');
|
|
|
|
|
|
|
|
module.exports = class extends StdinCommand {
|
2022-08-02 17:25:53 +01:00
|
|
|
constructor(client, options) {
|
2022-05-05 21:47:08 +01:00
|
|
|
super(client, {
|
2022-08-02 17:25:53 +01:00
|
|
|
...options,
|
|
|
|
id: 'eval',
|
2022-05-05 21:47:08 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async run(input) {
|
|
|
|
const toEval = input.join(' ');
|
|
|
|
try {
|
|
|
|
const res = await eval(toEval);
|
2023-02-13 15:07:05 +00:00
|
|
|
console.log(res); // eslint-disable-line no-console
|
2022-08-02 17:32:55 +01:00
|
|
|
return true;
|
2022-05-05 21:47:08 +01:00
|
|
|
} catch (error) {
|
|
|
|
this.client.log.error(error);
|
2022-08-02 17:32:55 +01:00
|
|
|
return false;
|
2022-05-05 21:47:08 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|