2022-03-26 03:33:18 -05:00
|
|
|
const { inspect } = require("util");
|
2021-01-19 14:02:09 -06:00
|
|
|
module.exports = {
|
2021-01-23 01:08:05 -06:00
|
|
|
|
2021-01-19 14:02:09 -06:00
|
|
|
name: 'eval',
|
2022-03-28 13:06:41 -05:00
|
|
|
description: 'Executes JS code',
|
2022-04-18 11:06:24 -05:00
|
|
|
async execute(_, message, args, config) {
|
2022-03-28 13:06:41 -05:00
|
|
|
if (message.author.id == config.ownerID) {
|
2022-03-26 03:33:18 -05:00
|
|
|
try {
|
|
|
|
const code = args.join(" ");
|
|
|
|
const evaled = inspect(eval(code));
|
|
|
|
await message.channel.send(evaled, {code:"xl"});
|
|
|
|
} catch (error) {
|
2022-03-26 11:02:17 -05:00
|
|
|
await message.channel.send({embed: {
|
2022-03-28 13:06:41 -05:00
|
|
|
"title": "<:AnitroxError:809651936563429416> **Something went wrong! **",
|
2022-03-26 03:33:18 -05:00
|
|
|
"color": 13632027,
|
2022-03-26 12:31:03 -05:00
|
|
|
"footer": {
|
|
|
|
"icon_url": message.author.displayAvatarURL(),
|
2022-03-28 13:06:41 -05:00
|
|
|
"text": config.footerTxt
|
2022-03-26 12:31:03 -05:00
|
|
|
},
|
2022-03-26 03:33:18 -05:00
|
|
|
"fields": [
|
|
|
|
{
|
|
|
|
"name": "**What Happened?**",
|
|
|
|
"value": "The command you tried to run failed to execute due to an error."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Error Info",
|
|
|
|
"value": error.message
|
|
|
|
}
|
|
|
|
]
|
2022-03-26 11:02:17 -05:00
|
|
|
}});
|
2022-03-26 03:33:18 -05:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2021-01-19 14:02:09 -06:00
|
|
|
}
|