mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
34 lines
1.3 KiB
JavaScript
34 lines
1.3 KiB
JavaScript
/* eslint-disable no-eval */
|
|
/* eslint-disable max-len */
|
|
const util = require('util')
|
|
const { stylize } = require('../util/colors/minecraft')
|
|
const { MessageEmbed } = require('discord.js')
|
|
module.exports = {
|
|
name: 'servereval',
|
|
alias: [],
|
|
description: 'Basically eval command but without vm2',
|
|
trusted: 2,
|
|
usage: '<ownerhash> <code>',
|
|
execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
|
|
try {
|
|
bot.tellraw(selector, { text: util.inspect(eval(args.slice(1).join(' ')), { stylize }).substring(0, 32766) })
|
|
} catch (err) {
|
|
bot.tellraw(selector, { text: util.inspect(err).replaceAll('runner', 'chayapak1'), color: 'red' })
|
|
}
|
|
},
|
|
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
|
|
try {
|
|
const Embed = new MessageEmbed()
|
|
.setColor(config.discord.embedsColors.normal)
|
|
.setTitle('Output')
|
|
.setDescription(util.inspect(eval(args.join(' ')), { stylize }))
|
|
channeldc.send({ embeds: [Embed] })
|
|
} catch (err) {
|
|
const Embed = new MessageEmbed()
|
|
.setColor(config.discord.embedsColors.error)
|
|
.setTitle('Error')
|
|
.setDescription(`\`\`\`${util.inspect(err).replaceAll('runner', 'chayapak1')}\`\`\``)
|
|
channeldc.send({ embeds: [Embed] })
|
|
}
|
|
}
|
|
}
|