master
Kit Kasune 4 years ago
parent 9813a8d3f3
commit 8a64b6fcb8
  1. 2
      bot.js
  2. 39
      commands/eval.js
  3. 2
      commands/help.js
  4. 2
      commands/info.js

@ -11,5 +11,7 @@ async function init() {
['commands', 'aliases'].forEach(x => client[x] = new Discord.Collection()); ['commands', 'aliases'].forEach(x => client[x] = new Discord.Collection());
['command', 'event'].forEach(x => require(`./handle/${x}`)(client)); ['command', 'event'].forEach(x => require(`./handle/${x}`)(client));
client.developers = ["330547934951112705", "673477059904929802"];
} }
init(); init();

@ -0,0 +1,39 @@
const Discord = require('discord.js');
const util = require('util');
const moment = require('moment');
const chalk = require('chalk');
module.exports = {
name: 'eval',
aliases: ['ev', ':'],
help: "Evaluates raw JavaScript code. *This is a __developer-only__ command.* Usage: `{{p}}eval <code>`",
execute(message, msg, args, cmd, prefix, mention, client) {
try {
if (!client.developers.includes(message.author.id)) return;
let kieran = client.users.cache.get('673477059904929802').tag
if (!args.length) return message.channel.send(`Syntax: \`${prefix}eval <code>\``);
const result = new Promise((resolve) => resolve(eval(args.join(' '))));
return result.then((output) => {
if (typeof output !== 'string') {
output = require('util').inspect(output, { depth: 0 });
}
output = output.replace(client.config.token, 'Client Token')
.replace(client.config.database.password, 'Database Password')
.replace(client.config.database.cluster, 'Database Cluster')
return message.channel.send(new Discord.MessageEmbed()
.setTitle('Client Evaluation')
.setDescription(`\`\`\`js\n${output}\n\`\`\``)
.setColor('c375f0')
.setFooter(`Natsuki`, client.user.avatarURL())
.setTimestamp())
});
} catch (error) {
//let date = new Date; date = date.toString().slice(date.toString().search(":") - 2, date.toString().search(":") + 6);
//console.error(`\n${chalk.red('[ERROR]')} >> ${chalk.yellow(`At [${date}] | Occurred while trying to run n?eval`)}`, error);
return message.channel.send(`Error: \`${error}\`.`);
};
},
};

@ -6,7 +6,7 @@ module.exports = {
help: 'you silly! What did you expect me to respond with?', help: 'you silly! What did you expect me to respond with?',
execute(message, msg, args, cmd, prefix, mention, client) { execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) { if (!args.length) {
// !!! this is where the base help command goes, like n?help without specifying a command.
} else { } else {
var command; var command;
if (client.commands.has(args[0])) {command = client.commands.get(args[0]);} if (client.commands.has(args[0])) {command = client.commands.get(args[0]);}

@ -9,7 +9,7 @@ module.exports = {
let botData = await require('../models/bot').findOne({finder: 'lel'}); let botData = await require('../models/bot').findOne({finder: 'lel'});
return message.channel.send(new Discord.MessageEmbed() return message.channel.send(new Discord.MessageEmbed()
.setAuthor("About Me!", client.users.cache.get(["330547934951112705", "673477059904929802"][Math.floor(Math.random() * 2)]).avatarURL()) .setAuthor("About Me!", client.users.cache.get(client.developers[Math.floor(Math.random() * client.developers.length)]).avatarURL())
.setThumbnail(client.user.avatarURL({size: 1024})) .setThumbnail(client.user.avatarURL({size: 1024}))
.setDescription(`I am created by WubzyGD#8766 and Slushie#1234 - a pair conveniently known as NatsukiDev - in JavaScript/Discord.js!\n\nI'm a powerful all-purpose bot with everything you could want or need, and I have my own set of unique skills that you won't find anywhere else ^^`) .setDescription(`I am created by WubzyGD#8766 and Slushie#1234 - a pair conveniently known as NatsukiDev - in JavaScript/Discord.js!\n\nI'm a powerful all-purpose bot with everything you could want or need, and I have my own set of unique skills that you won't find anywhere else ^^`)
.addField("Presence", `I'm currently in **${client.guilds.cache.size}** servers, and I'm watching over approximately **${client.users.cache.size}** people!`) .addField("Presence", `I'm currently in **${client.guilds.cache.size}** servers, and I'm watching over approximately **${client.users.cache.size}** people!`)

Loading…
Cancel
Save