Remove Yoda Command (API is too Slow)

This commit is contained in:
Daniel Odendahl Jr
2017-04-16 15:55:30 +00:00
parent 98e371514b
commit 56af47e839
6 changed files with 6 additions and 46 deletions
+2 -2
View File
@@ -16,14 +16,14 @@ You can join the home server with [this link](https://discord.gg/fqQF8mc).
[discord.js](https://discord.js.org/#/), [commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [snekfetch](https://github.com/GusCaplan/snekfetch), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/)
## APIs
[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Yoda Speak](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/)
[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/)
## Self-Hosting
You can Self-Host the bot easily, provided you have API keys and a Discord Bot Token. [Node.js](https://nodejs.org/en/) is also required, with at least version 7.8.0 recommended.
APIs that require API Keys:
[Wattpad](https://developer.wattpad.com/docs/api) | [Wordnik](http://developer.wordnik.com/docs.html) | [osu!](https://osu.ppy.sh/p/api) | [YouTube Data](https://developers.google.com/youtube/v3/) | [Yoda Speak](https://market.mashape.com/ismaelc/yoda-speak)
[Wattpad](https://developer.wattpad.com/docs/api) | [Wordnik](http://developer.wordnik.com/docs.html) | [osu!](https://osu.ppy.sh/p/api) | [YouTube Data](https://developers.google.com/youtube/v3/)
> Note: If you do self-host, you will need to go into the file `index.js` and remove the entries for requests to Discord Bots and Carbon.
-38
View File
@@ -1,38 +0,0 @@
const { Command } = require('discord.js-commando');
const snekfetch = require('snekfetch');
module.exports = class YodaCommand extends Command {
constructor(client) {
super(client, {
name: 'yoda',
group: 'textedit',
memberName: 'yoda',
description: 'Converts text to Yoda Speak. (;yoda This is Yoda.)',
examples: [';yoda This is Yoda.'],
args: [{
key: 'text',
prompt: 'What text would you like to convert to Yoda speak?',
type: 'string'
}]
});
}
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
const text = encodeURIComponent(args.text);
try {
const response = await snekfetch
.get(`https://yoda.p.mashape.com/yoda?sentence=${text}`)
.set({
'X-Mashape-Key': process.env.MASHAPE_KEY,
'Accept': 'text/plain'
});
return message.say(`\u180E${response.text}`);
}
catch (err) {
return message.say(':x: Error! Something went wrong!');
}
}
};
+2 -2
View File
@@ -33,7 +33,7 @@ module.exports = class InfoCommand extends Command {
.addField('Shards',
`${this.client.options.shardCount} (${this.client.shard.id})`, true)
.addField('Commands',
'109', true)
'108', true)
.addField('Owner',
'dragonfire535#8081', true)
.addField('Source Code',
@@ -49,7 +49,7 @@ module.exports = class InfoCommand extends Command {
.addField('Modules',
'[commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [snekfetch](https://github.com/GusCaplan/snekfetch), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/)')
.addField('APIs',
'[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Yoda Speak](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Wikipedia](https://en.wikipedia.org/w/api.php), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/)');
'[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Wikipedia](https://en.wikipedia.org/w/api.php), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/)');
return message.embed(embed);
}
};
-1
View File
@@ -34,7 +34,6 @@
<li><a href="https://memegen.link/">memegen.link</a></li>
<li><a href="http://docs.yugiohprices.apiary.io/#">Yugioh Prices</a></li>
<li><a href="https://developers.google.com/youtube/v3/">YouTube Data</a></li>
<li><a href="https://market.mashape.com/ismaelc/yoda-speak">Yoda Speak</a></li>
<li><a href="https://bots.discord.pw/api">Discord Bots</a></li>
<li><a href="http://history.muffinlabs.com/#api">Today in History</a></li>
<li><a href="http://jservice.io/">jService</a></li>
+1 -1
View File
@@ -39,7 +39,7 @@
<li>Get Weather and Forecasts for a Location</li>
<li>Search Wikipedia</li>
<li>Get Yu-Gi-Oh! Card Data</li>
<li>Pirate, Binary, and Yoda Translators</li>
<li>Pirate, Binary, and Temmie Translators</li>
<li>Reverse Text</li>
<li>Zalgoize Text</li>
<li>And so so so much more!</li>
+1 -2
View File
@@ -44,7 +44,7 @@
<li>Get Weather and Forecasts for a Location</li>
<li>Search Wikipedia</li>
<li>Get Yu-Gi-Oh! Card Data</li>
<li>Pirate, Binary, and Yoda Translators</li>
<li>Pirate, Binary, and Temmie Translators</li>
<li>Reverse Text</li>
<li>Zalgoize Text</li>
<li>And so so so much more!</li>
@@ -78,7 +78,6 @@
<li><a href="https://memegen.link/">memegen.link</a></li>
<li><a href="http://docs.yugiohprices.apiary.io/#">Yugioh Prices</a></li>
<li><a href="https://developers.google.com/youtube/v3/">YouTube Data</a></li>
<li><a href="https://market.mashape.com/ismaelc/yoda-speak">Yoda Speak</a></li>
<li><a href="https://bots.discord.pw/api">Discord Bots</a></li>
<li><a href="http://history.muffinlabs.com/#api">Today in History</a></li>
<li><a href="http://jservice.io/">jService</a></li>