From 5b8b794c92b94d820373bfc327dae3249a683856 Mon Sep 17 00:00:00 2001 From: rhearmas <34490428+qu-ota@users.noreply.github.com> Date: Fri, 13 Dec 2019 14:15:19 -0500 Subject: [PATCH] that's odd :thinking: --- commands/Utility/dictionary.js | 96 ---------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 commands/Utility/dictionary.js diff --git a/commands/Utility/dictionary.js b/commands/Utility/dictionary.js deleted file mode 100644 index 4e63c75..0000000 --- a/commands/Utility/dictionary.js +++ /dev/null @@ -1,96 +0,0 @@ -/* -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) => { - message.delete(); - - if (!args[0]) return message.reply("you didn't provide a valid word to look up."); - - const parsed = client.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.channel.send({ - embed: bot.utils.embed(`:book: ${word}`, result) - }); - }); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ['dict'], - permLevel: "User" -}; - -exports.help = { - name: "dictionary", - category: "Utility", - description: "Looks up a word in the dictionary.", - usage: "dictionary " -};