2022-11-27 02:35:28 -05:00
|
|
|
/* eslint-disable no-eval */
|
|
|
|
const util = require('util')
|
|
|
|
const { stylize } = require('../util/colors/minecraft')
|
2022-12-24 00:59:52 -05:00
|
|
|
const { EmbedBuilder } = require('discord.js')
|
2022-08-14 05:51:45 -04:00
|
|
|
module.exports = {
|
|
|
|
name: 'servereval',
|
|
|
|
alias: [],
|
2022-11-23 04:24:00 -05:00
|
|
|
description: 'Basically eval command but without vm2',
|
2022-08-14 05:51:45 -04:00
|
|
|
trusted: 2,
|
|
|
|
usage: '<ownerhash> <code>',
|
2022-12-14 08:51:30 -05:00
|
|
|
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
|
2022-11-23 04:24:00 -05:00
|
|
|
try {
|
2022-12-02 07:35:08 -05:00
|
|
|
bot.tellraw(selector, { text: util.inspect(eval(args.slice(1).join(' ')), { stylize }).substring(0, 32700) })
|
2022-11-23 04:24:00 -05:00
|
|
|
} catch (err) {
|
2022-11-27 02:35:28 -05:00
|
|
|
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'chayapak1'), color: 'red' })
|
2022-11-23 06:10:45 -05:00
|
|
|
}
|
|
|
|
},
|
2022-12-14 08:51:30 -05:00
|
|
|
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
|
2022-11-23 06:10:45 -05:00
|
|
|
try {
|
2022-12-24 00:59:52 -05:00
|
|
|
const Embed = new EmbedBuilder()
|
2022-12-01 05:15:30 -05:00
|
|
|
.setColor(config.discord.embedsColors.normal)
|
2022-11-27 02:35:28 -05:00
|
|
|
.setTitle('Output')
|
2022-12-13 07:17:04 -05:00
|
|
|
.setDescription(util.inspect(eval(args.join(' '))))
|
2022-11-27 02:35:28 -05:00
|
|
|
channeldc.send({ embeds: [Embed] })
|
2022-11-23 06:10:45 -05:00
|
|
|
} catch (err) {
|
2022-12-24 00:59:52 -05:00
|
|
|
const Embed = new EmbedBuilder()
|
2022-12-01 05:15:30 -05:00
|
|
|
.setColor(config.discord.embedsColors.error)
|
2022-11-27 02:35:28 -05:00
|
|
|
.setTitle('Error')
|
|
|
|
.setDescription(`\`\`\`${util.inspect(err).replaceAll('runner', 'chayapak1')}\`\`\``)
|
|
|
|
channeldc.send({ embeds: [Embed] })
|
2022-08-14 05:51:45 -04:00
|
|
|
}
|
2022-11-27 02:35:28 -05:00
|
|
|
}
|
|
|
|
}
|