mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Remove IMDB
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -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>
|
||||
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "20.1.2",
|
||||
"version": "21.0.0",
|
||||
"description": "A Discord Bot",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user