Remove IMDB

This commit is contained in:
Daniel Odendahl Jr
2017-05-24 18:05:16 +00:00
parent 151c52df05
commit 045fec4448
5 changed files with 2 additions and 65 deletions
+1 -2
View File
@@ -30,8 +30,7 @@ module.exports = class QuizCommand extends Command {
const embed = new RichEmbed()
.setTitle('You have **15** seconds to answer this question:')
.setDescription(stripIndents`
**Category: ${decodeURIComponent(body.results[0].category)}**
**Difficulty: ${decodeURIComponent(body.results[0].difficulty)}**
**${decodeURIComponent(body.results[0].category)}**
True or False: ${decodeURIComponent(body.results[0].question)}
`);
msg.embed(embed);
-60
View File
@@ -1,60 +0,0 @@
const { Command } = require('discord.js-commando');
const { RichEmbed } = require('discord.js');
const snekfetch = require('snekfetch');
module.exports = class IMDBCommand extends Command {
constructor(client) {
super(client, {
name: 'imdb',
group: 'search',
memberName: 'imdb',
description: 'Searches IMDB for a specified movie.',
args: [
{
key: 'query',
prompt: 'What movie or TV Show would you like to search for?',
type: 'string'
}
]
});
}
async run(msg, args) {
if (msg.channel.type !== 'dm')
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { query } = args;
try {
const { body } = await snekfetch
.get('http://www.omdbapi.com/')
.query({
t: query,
plot: 'full'
});
if (body.Error) throw new Error('No Results.');
const embed = new RichEmbed()
.setColor(0xDBA628)
.setAuthor('IMDB', 'https://i.imgur.com/sXwwIQs.png')
.setURL(`http://www.imdb.com/title/${body.imdbID}`)
.setTitle(`${body.Title} (${body.imdbRating} Score)`)
.setDescription(body.Plot.substr(0, 2000))
.addField('Genres',
body.Genre)
.addField('Year',
body.Year, true)
.addField('Rated',
body.Rated, true)
.addField('Runtime',
body.Runtime, true)
.addField('Directors',
body.Director)
.addField('Writers',
body.Writer)
.addField('Actors',
body.Actors);
return msg.embed(embed);
} catch (err) {
return msg.say(`${err.name}: ${err.message}`);
}
}
};
-1
View File
@@ -40,7 +40,6 @@
<li>Google</li>
<li>Discord Bots</li>
<li>Yahoo Weather</li>
<li>IMDB</li>
<li>Google Maps</li>
<li>Neopet Images</li>
<li>Osu!</li>
-1
View File
@@ -37,7 +37,6 @@
<li>Google</li>
<li>Discord Bots</li>
<li>Yahoo Weather</li>
<li>IMDB</li>
<li>Google Maps</li>
<li>Neopet Images</li>
<li>Osu!</li>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "20.1.2",
"version": "21.0.0",
"description": "A Discord Bot",
"main": "Shard.js",
"scripts": {