From 4ee231e726edc050d75db5ff639140305cdd284d Mon Sep 17 00:00:00 2001 From: Carol Knieriem Date: Thu, 19 Dec 2019 14:46:03 -0500 Subject: [PATCH] removed original commented code --- commands/Utility/calculator.js | 32 -------------------- commands/Utility/urban.js | 54 ---------------------------------- 2 files changed, 86 deletions(-) diff --git a/commands/Utility/calculator.js b/commands/Utility/calculator.js index 93208d9..ff47d7a 100644 --- a/commands/Utility/calculator.js +++ b/commands/Utility/calculator.js @@ -1,35 +1,3 @@ -/* -exports.run = (bot, msg, args) => { - if (args.length < 1) { - throw 'You must provide a equation to be solved on the calculator'; - } - - const question = args.join(' '); - - let answer; - try { - answer = math.eval(question); - } catch (err) { - throw `Invalid math equation: ${err}`; - } - - msg.delete(); - msg.channel.send({ - embed: bot.utils.embed('', stripIndents` - **Equation:**\n\`\`\`\n${question}\n\`\`\` - **Answer:**\n\`\`\`\n${answer}\n\`\`\` - `) - }); -}; - -exports.info = { - name: 'calculate', - usage: 'calculate ', - aliases: ['calc', 'math'], - description: 'Calculates any math equation', - credits: 'Carbowix', -}; -*/ const math = require('math-expression-evaluator'); const stripIndents = require('common-tags').stripIndents; diff --git a/commands/Utility/urban.js b/commands/Utility/urban.js index baa5bbc..721c307 100644 --- a/commands/Utility/urban.js +++ b/commands/Utility/urban.js @@ -1,57 +1,3 @@ -/* -const makeCommand = method => { - return (bot, msg, args) => { - if (args.length < 1) { - throw 'Please provide a word to search!'; - } - - const parsed = bot.utils.parseArgs(args, ['e']); - const word = parsed.leftover.join(' '); - - webdict(method, word).then(res => { - let result; - if (!res || !res.definition || !res.definition[0]) { - result = 'No results found.'; - } else { - result = res.definition[0]; - } - - if (parsed.options.e) { - msg.edit(result); - return; - } - - msg.delete(); - msg.channel.send({ - embed: bot.utils.embed(`:book: ${word}`, result) - }); - }); - }; -}; - -module.exports = [ - { - run: makeCommand('dictionary'), - info: { - name: 'dictionary', - aliases: ['dict'], - usage: 'dictionary ', - description: 'Looks a word up in the dictionary.', - credits: 'NITEHAWK' - } - }, - { - run: makeCommand('urbandictionary'), - info: { - name: 'urban', - usage: 'urban ', - description: 'Looks a word up in the urban dictionary.', - credits: 'NITEHAWK' - } - } -]; -*/ - const webdict = require('webdict'); exports.run = async (client, message, args, level) => {