mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 00:09:08 +02:00
More Fixes
This commit is contained in:
@@ -28,7 +28,7 @@ module.exports = class MovieCommand extends Command {
|
|||||||
.get('http://api.themoviedb.org/3/search/movie')
|
.get('http://api.themoviedb.org/3/search/movie')
|
||||||
.query({
|
.query({
|
||||||
api_key: TMDB_KEY,
|
api_key: TMDB_KEY,
|
||||||
include_adult: msg.channel.nsfw,
|
include_adult: msg.channel.nsfw || false,
|
||||||
query
|
query
|
||||||
});
|
});
|
||||||
if (!search.body.results.length) return msg.say('No Results.');
|
if (!search.body.results.length) return msg.say('No Results.');
|
||||||
@@ -40,12 +40,12 @@ module.exports = class MovieCommand extends Command {
|
|||||||
.setTitle(body.title)
|
.setTitle(body.title)
|
||||||
.setURL(`https://www.themoviedb.org/movie/${body.id}`)
|
.setURL(`https://www.themoviedb.org/movie/${body.id}`)
|
||||||
.setAuthor('TMDB', 'https://i.imgur.com/G9q4DF1.png')
|
.setAuthor('TMDB', 'https://i.imgur.com/G9q4DF1.png')
|
||||||
.setDescription(body.overview.substr(0, 2048))
|
.setDescription(body.overview ? body.overview.substr(0, 2048) : 'No description available.')
|
||||||
.setThumbnail(body.poster_path ? `https://image.tmdb.org/t/p/w500${body.poster_path}` : null)
|
.setThumbnail(body.poster_path ? `https://image.tmdb.org/t/p/w500${body.poster_path}` : null)
|
||||||
.addField('❯ Runtime',
|
.addField('❯ Runtime',
|
||||||
`${body.runtime} mins.`, true)
|
body.runtime ? `${body.runtime} mins.` : 'N/A', true)
|
||||||
.addField('❯ Release Date',
|
.addField('❯ Release Date',
|
||||||
body.release_date, true)
|
body.release_date || 'N/A', true)
|
||||||
.addField('❯ Genres',
|
.addField('❯ Genres',
|
||||||
body.genres.length ? body.genres.map(genre => genre.name).join(', ') : 'N/A')
|
body.genres.length ? body.genres.map(genre => genre.name).join(', ') : 'N/A')
|
||||||
.addField('❯ Production Companies',
|
.addField('❯ Production Companies',
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ module.exports = class TVShowCommand extends Command {
|
|||||||
.get('http://api.themoviedb.org/3/search/tv')
|
.get('http://api.themoviedb.org/3/search/tv')
|
||||||
.query({
|
.query({
|
||||||
api_key: TMDB_KEY,
|
api_key: TMDB_KEY,
|
||||||
include_adult: msg.channel.nsfw,
|
include_adult: msg.channel.nsfw || false,
|
||||||
query
|
query
|
||||||
});
|
});
|
||||||
if (!search.body.results.length) return msg.say('No Results.');
|
if (!search.body.results.length) return msg.say('No Results.');
|
||||||
@@ -40,16 +40,16 @@ module.exports = class TVShowCommand extends Command {
|
|||||||
.setTitle(body.name)
|
.setTitle(body.name)
|
||||||
.setURL(`https://www.themoviedb.org/tv/${body.id}`)
|
.setURL(`https://www.themoviedb.org/tv/${body.id}`)
|
||||||
.setAuthor('TMDB', 'https://i.imgur.com/G9q4DF1.png')
|
.setAuthor('TMDB', 'https://i.imgur.com/G9q4DF1.png')
|
||||||
.setDescription(body.overview.substr(0, 2048))
|
.setDescription(body.overview ? body.overview.substr(0, 2048) : 'No description available.')
|
||||||
.setThumbnail(body.poster_path ? `https://image.tmdb.org/t/p/w500${body.poster_path}` : null)
|
.setThumbnail(body.poster_path ? `https://image.tmdb.org/t/p/w500${body.poster_path}` : null)
|
||||||
.addField('❯ First Air Date',
|
.addField('❯ First Air Date',
|
||||||
body.first_air_date, true)
|
body.first_air_date || 'N/A', true)
|
||||||
.addField('❯ Last Air Date',
|
.addField('❯ Last Air Date',
|
||||||
body.last_air_date, true)
|
body.last_air_date || 'N/A', true)
|
||||||
.addField('❯ Seasons',
|
.addField('❯ Seasons',
|
||||||
body.number_of_seasons, true)
|
body.number_of_seasons || 'N/A', true)
|
||||||
.addField('❯ Episodes',
|
.addField('❯ Episodes',
|
||||||
body.number_of_episodes, true)
|
body.number_of_episodes || 'N/A', true)
|
||||||
.addField('❯ Genres',
|
.addField('❯ Genres',
|
||||||
body.genres.length ? body.genres.map(genre => genre.name).join(', ') : 'N/A')
|
body.genres.length ? body.genres.map(genre => genre.name).join(', ') : 'N/A')
|
||||||
.addField('❯ Production Companies',
|
.addField('❯ Production Companies',
|
||||||
|
|||||||
Reference in New Issue
Block a user