This commit is contained in:
Emily 2020-10-20 12:27:34 +11:00
parent 4ac2d2e927
commit 00bbebcf4a
32 changed files with 0 additions and 3610 deletions

View file

@ -1,37 +0,0 @@
const Command = require('../../base/Command.js');
const Discord = require('discord.js');
class Eval extends Command {
constructor (client) {
super(client, {
description: 'Evaluates arbitrary Javascript.',
usage: 'eval <expression>',
aliases: ['ev'],
permLevel: 'Bot Owner',
devOnly: true
});
}
async run (message, args, data) { // eslint-disable-line no-unused-vars
const code = args.join(' ');
try {
const evaled = eval(code);
const clean = await this.client.functions.clean(evaled);
const MAX_CHARS = 3 + 2 + clean.length + 3;
if (MAX_CHARS > 2000) {
message.channel.send({ files: [new Discord.MessageAttachment(Buffer.from(clean), 'output.txt')] });
}
message.channel.send(`\`\`\`js\n${clean}\n\`\`\``);
} catch (err) {
const e = await this.client.functions.clean(err);
const MAX_CHARS = 1 + 5 + 1 + 3 + e.length + 3;
if (MAX_CHARS > 2000) {
return message.channel.send({ files: [new Discord.MessageAttachment(Buffer.from(e), 'error.txt')] });
}
message.channel.send(`\`ERROR\` \`\`\`xl\n${e}\n\`\`\``);
}
}
}
module.exports = Eval;

View file

@ -1,38 +0,0 @@
const Command = require('../../base/Command.js');
class Reload extends Command {
constructor (client) {
super(client, {
description: 'Latency and API response times.',
usage: '`reload [command]` - Reloads the specified command.',
examples: '`reload ping`',
devOnly: true
});
}
async run (message, args, data) { // eslint-disable-line no-unused-vars
if (!args[0]) return message.channel.send('You didnt tell me what command to reload!');
let command;
if (this.client.commands.has(args[0])) {
command = this.client.commands.get(args[0]);
} else if (this.client.aliases.has(args[0])) {
command = this.client.commands.get(this.client.aliases.get(args[0]));
}
if (!command) return message.channel.send(
`\`${args[0]}\` does not exist as a command or an alias.`
);
let res = await this.client.commandHandler.unload(command.help.name, command.help.category);
if (res) return message.channel.send('Error unloading: '+ res);
res = await this.client.commandHandler.load(command.help.name, command.help.category);
if (res) return message.channel.send('Error loading: ' + res);
return message.channel.send(`Reloaded \`${args[0]}\``);
}
}
module.exports = Reload;