From 57d5c71f0e418b199e17ee6c10aa6eb70ee2261e Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 20 Mar 2017 12:11:24 +0000 Subject: [PATCH] Remove Google Support --- commands/botinfo/info.js | 2 +- commands/search/google.js | 50 --------------------------------------- package.json | 1 - 3 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 commands/search/google.js diff --git a/commands/botinfo/info.js b/commands/botinfo/info.js index 94a204e9..7b7b6b25 100644 --- a/commands/botinfo/info.js +++ b/commands/botinfo/info.js @@ -54,7 +54,7 @@ class InfoCommand extends commando.Command { .addField('Library', "[discord.js](https://discord.js.org/#/) / [commando](https://github.com/Gawdl3y/discord.js-commando)") .addField('Modules', - "[cleverbot-node](https://github.com/fojas/cleverbot-node), [pirate-speak](https://github.com/mikewesthad/pirate-speak), [google-translate-api](https://github.com/matheuss/google-translate-api), [urban](https://github.com/mvrilo/urban), [zalgoize](https://github.com/clux/zalgolize), [hepburn](https://github.com/lovell/hepburn), [yahoo-weather](https://github.com/mamal72/node-yahoo-weather), [imdb-api](https://github.com/worr/node-imdb-api), [string-to-binary](https://www.npmjs.com/package/string-to-binary), [google](https://github.com/jprichardson/node-google), [roman-numeral-converter-mmxvi](https://github.com/Cein-Markey/roman-numeral-conversion-library), [cowsay](https://github.com/piuccio/cowsay), [morse](https://github.com/ecto/morse)") + "[cleverbot-node](https://github.com/fojas/cleverbot-node), [pirate-speak](https://github.com/mikewesthad/pirate-speak), [google-translate-api](https://github.com/matheuss/google-translate-api), [urban](https://github.com/mvrilo/urban), [zalgoize](https://github.com/clux/zalgolize), [hepburn](https://github.com/lovell/hepburn), [yahoo-weather](https://github.com/mamal72/node-yahoo-weather), [imdb-api](https://github.com/worr/node-imdb-api), [string-to-binary](https://www.npmjs.com/package/string-to-binary), [roman-numeral-converter-mmxvi](https://github.com/Cein-Markey/roman-numeral-conversion-library), [cowsay](https://github.com/piuccio/cowsay), [morse](https://github.com/ecto/morse)") .addField('Utility Modules', "[request](https://github.com/request/request), [request-promise](https://github.com/request/request-promise), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [opusscript](https://github.com/abalabahaha/opusscript), [jimp](https://github.com/oliver-moran/jimp)") .addField('APIs', diff --git a/commands/search/google.js b/commands/search/google.js deleted file mode 100644 index 28615377..00000000 --- a/commands/search/google.js +++ /dev/null @@ -1,50 +0,0 @@ -const commando = require('discord.js-commando'); -const google = require('google'); - -class GoogleCommand extends commando.Command { - constructor(Client){ - super(Client, { - name: 'google', - group: 'search', - memberName: 'google', - description: 'Searches Google for something. (;google Discord)', - examples: [';google Discord'] - }); - } - - async run(message, args) { - if(message.channel.type !== 'dm') { - if(!message.channel.permissionsFor(this.client.user).hasPermission('SEND_MESSAGES')) return; - if(!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGES')) return; - } - console.log("[Command] " + message.content); - let searchQuery = message.content.split(" ").slice(1).join(" "); - if(searchQuery === "") { - message.channel.send(':x: Error! I cannot search google for nothing!'); - } else { - google.resultsPerPage = 2 - google(searchQuery, function (err, res) { - if (res === undefined) { - message.channel.send(':x: Error! Too many requests! Try again later! (Much later)'); - } else { - let link = res.links; - if(link === undefined) { - message.channel.send(':x: Error! No Results Found!'); - } else { - if(link[0] === undefined) { - message.channel.send(':x: Error! No Results Found!'); - } else { - if(link[0].href === null) { - message.channel.send(':x: Error! No Results Found!'); - } else { - message.channel.send(link[0].href).catch(error => message.channel.send(':x: An Error Occurred! Try again later!')); - } - } - } - } - }); - } - } -} - -module.exports = GoogleCommand; \ No newline at end of file diff --git a/package.json b/package.json index 1a3ba058..c45d5d07 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "cowsay": "^1.1.9", "discord.js": "github:hydrabolt/discord.js", "discord.js-commando": "^0.9.0", - "google": "^2.1.0", "google-translate-api": "^2.2.2", "hepburn": "^1.0.0", "imdb-api": "^2.2.1",