mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 16:19:12 +02:00
Remove commands that no longer work, fix others
This commit is contained in:
@@ -57,7 +57,7 @@ module.exports = class AnimeCommand extends Command {
|
||||
.setAuthor('AniList', 'https://i.imgur.com/iUIRC7v.png', 'https://anilist.co/')
|
||||
.setURL(`https://anilist.co/anime/${anime.id}`)
|
||||
.setThumbnail(anime.coverImage.large || null)
|
||||
.setTitle(anime.title.userPreferred)
|
||||
.setTitle(anime.title.english || anime.title.userPreferred)
|
||||
.setDescription(anime.description ? shorten(anime.description.replace(/(<br>)+/g, '\n')) : 'No description.')
|
||||
.addField('❯ Status', anime.status, true)
|
||||
.addField('❯ Episodes', anime.episodes, true)
|
||||
|
||||
@@ -52,9 +52,9 @@ module.exports = class AzurLaneCommand extends Command {
|
||||
.addField('❯ Aviation', `${formatNumber(data.base.air_power)} (${formatNumber(data.max.air_power)} Max)`, true)
|
||||
.addField('❯ Oil Cost', `${formatNumber(data.base.oil_usage)} (${formatNumber(data.max.oil_usage)} Max)`, true)
|
||||
.addField('❯ Equipment', stripIndents`
|
||||
${data.equipment[0].equippable} (${data.equipment[0].efficiency})
|
||||
${data.equipment[1].equippable} (${data.equipment[1].efficiency})
|
||||
${data.equipment[2].equippable} (${data.equipment[2].efficiency})
|
||||
${data.equipment[0].equipable} (${data.equipment[0].efficiency})
|
||||
${data.equipment[1].equipable} (${data.equipment[1].efficiency})
|
||||
${data.equipment[2].equipable} (${data.equipment[2].efficiency})
|
||||
`)
|
||||
.addField('❯ Images',
|
||||
`${data.images.map(img => `[${img.name}](${img.url})`).join(', ')}, [Chibi](${data.chibi})`);
|
||||
|
||||
@@ -44,8 +44,7 @@ module.exports = class BookCommand extends Command {
|
||||
.setThumbnail(data.imageLinks ? data.imageLinks.thumbnail : null)
|
||||
.addField('❯ Authors', data.authors.length ? data.authors.join(', ') : '???')
|
||||
.addField('❯ Publish Date', data.publishedDate || '???', true)
|
||||
.addField('❯ Page Count', data.pageCount ? formatNumber(data.pageCount) : '???', true)
|
||||
.addField('❯ Genres', data.categories.length ? data.categories.join(', ') : '???');
|
||||
.addField('❯ Page Count', data.pageCount ? formatNumber(data.pageCount) : '???', true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const request = require('node-superfetch');
|
||||
const { shorten } = require('../../util/Util');
|
||||
|
||||
module.exports = class KhWikiCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'kh-wiki',
|
||||
aliases: ['kingdom-hearts-wiki'],
|
||||
group: 'search',
|
||||
memberName: 'kh-wiki',
|
||||
description: 'Searches the Kingdom Hearts Wiki for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What article would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('https://www.khwiki.com/api.php')
|
||||
.query({
|
||||
action: 'query',
|
||||
prop: 'extracts|pageimages',
|
||||
format: 'json',
|
||||
titles: query,
|
||||
exintro: '',
|
||||
explaintext: '',
|
||||
pithumbsize: 150,
|
||||
redirects: '',
|
||||
formatversion: 2
|
||||
});
|
||||
const data = body.query.pages[0];
|
||||
if (data.missing) return msg.say('Could not find any results.');
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x0679BC)
|
||||
.setTitle(data.title)
|
||||
.setAuthor('Kingdom Hearts Wiki', 'https://i.imgur.com/OZhrA41.jpg', 'https://www.khwiki.com/')
|
||||
.setThumbnail(data.thumbnail ? data.thumbnail.source : null)
|
||||
.setURL(`https://www.khwiki.com/${encodeURIComponent(query).replace(/\)/g, '%29')}`)
|
||||
.setDescription(shorten(data.extract.replace(/.+\n\n/, '').replace(/\n/g, '\n\n')));
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -7,7 +7,7 @@ module.exports = class LeagueOfLegendsCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'league-of-legends',
|
||||
aliases: ['league-of-legends-champion', 'league-of-legends-champ', 'league-champ'],
|
||||
aliases: ['league-of-legends-champion', 'league-of-legends-champ', 'league-champ', 'lol-champ'],
|
||||
group: 'search',
|
||||
memberName: 'league-of-legends',
|
||||
description: 'Responds with information on a League of Legends champion.',
|
||||
|
||||
@@ -57,7 +57,7 @@ module.exports = class MangaCommand extends Command {
|
||||
.setAuthor('AniList', 'https://i.imgur.com/iUIRC7v.png', 'https://anilist.co/')
|
||||
.setURL(`https://anilist.co/manga/${manga.id}`)
|
||||
.setThumbnail(manga.coverImage.large || null)
|
||||
.setTitle(manga.title.userPreferred)
|
||||
.setTitle(manga.title.english || manga.title.userPreferred)
|
||||
.setDescription(manga.description ? shorten(manga.description.replace(/(<br>)+/g, '\n')) : 'No description.')
|
||||
.addField('❯ Status', manga.status, true)
|
||||
.addField('❯ Chapters / Volumes', `${manga.chapters || '???'}/${manga.volumes || '???'}`, true)
|
||||
|
||||
Reference in New Issue
Block a user