diff --git a/commands/clearstatus.js b/commands/clearstatus.js index 61a3681..4692d56 100644 --- a/commands/clearstatus.js +++ b/commands/clearstatus.js @@ -1,5 +1,6 @@ const Discord = require('discord.js'); const mongooes = require('mongoose'); + const UserData = require('../models/user'); module.exports = { @@ -15,6 +16,7 @@ module.exports = { tu.statusmsg = ''; tu.statustype = ''; tu.save(); + require('../util/siftstatuses')(client, message.author.id); return message.reply("welcome back! I cleared your status."); } }; \ No newline at end of file diff --git a/commands/eval.js b/commands/eval.js index 7bc4949..0e3c8af 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -1,15 +1,22 @@ const Discord = require('discord.js'); const chalk = require('chalk'); +const {Tag} = require('../util/tag'); +const {TagFilter} = require('../util/tagfilter'); + module.exports = { name: 'eval', aliases: ['ev', ':', 'e'], help: "Evaluates raw JavaScript code. *This is a __developer-only__ command.* Usage: `{{p}}eval `", execute(message, msg, args, cmd, prefix, mention, client) { try { - if (!client.developers.includes(message.author.id)) return; + if (!client.developers.includes(message.author.id)) {return message.channel.send("Sorry, but I've got trust issues, so only me devs can go commanding me around like that.");}; + if (!args.length) return message.channel.send(`Syntax: \`${prefix}eval \``); + + let options = new TagFilter([new Tag(['s', 'silent', 'nr', 'noreply'], 'silent', 'toggle')]).test(args[0]); + if (options.silent) {args.shift();} - if (!args.length) return message.channel.send(`Syntax: \`${prefix}eval \``); + if (!args.length) {return message.channel.send("Silly goose, if you want me to do something, you have to tell me what!");} const result = new Promise((resolve) => resolve(eval(args.join(' ')))); return result.then((output) => { if (typeof output !== 'string') { @@ -19,7 +26,7 @@ module.exports = { .replace(client.config.database.password, 'Database Password') .replace(client.config.database.cluster, 'Database Cluster'); - return message.channel.send(new Discord.MessageEmbed() + return options.silent ? null : message.channel.send(new Discord.MessageEmbed() .setTitle('Client Evaluation') .setDescription(`\`\`\`js\n${output}\n\`\`\``) .setColor('c375f0')