mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
MeesageEmbed
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { cleanXML } = require('../../structures/Util');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -32,7 +32,7 @@ module.exports = class AnimeCommand extends Command {
|
||||
.query({ q: query });
|
||||
const { anime } = await xml.parseStringAsync(text);
|
||||
const synopsis = cleanXML(anime.entry[0].synopsis[0].substr(0, 2000));
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x2D54A2)
|
||||
.setAuthor('My Anime List', 'https://i.imgur.com/R4bmNFz.png')
|
||||
.setURL(`https://myanimelist.net/anime/${anime.entry[0].id[0]}`)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { DBOTS_KEY } = process.env;
|
||||
|
||||
@@ -27,7 +27,7 @@ module.exports = class BotSearchCommand extends Command {
|
||||
const { body } = await snekfetch
|
||||
.get(`https://bots.discord.pw/api/bots/${bot.id}`)
|
||||
.set({ Authorization: DBOTS_KEY });
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setAuthor('Discord Bots', 'https://i.imgur.com/lrKYBQi.jpg')
|
||||
.setTitle(body.name)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class BulbapediaCommand extends Command {
|
||||
@@ -36,7 +36,7 @@ module.exports = class BulbapediaCommand extends Command {
|
||||
formatversion: 2
|
||||
});
|
||||
if (body.query.pages[0].missing) return msg.say('No Results.');
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x3E7614)
|
||||
.setTitle(body.query.pages[0].title)
|
||||
.setAuthor('Bulbapedia', 'https://i.imgur.com/09eYo5T.png')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { WORDNIK_KEY } = process.env;
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = class DefineCommand extends Command {
|
||||
api_key: WORDNIK_KEY
|
||||
});
|
||||
if (!body.length) return msg.say('No Results.');
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setTitle(body[0].word)
|
||||
.setDescription(body[0].text);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
|
||||
module.exports = class DiscrimCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -28,7 +28,7 @@ module.exports = class DiscrimCommand extends Command {
|
||||
run(msg, args) {
|
||||
const discrim = args.discrim || msg.author.discriminator;
|
||||
const users = this.client.users.filter((user) => user.discriminator === discrim).map((user) => user.username);
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${users.length} Users with the discriminator: ${discrim}`)
|
||||
.setDescription(users.join(', '));
|
||||
return msg.embed(embed);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class ForecastCommand extends Command {
|
||||
@@ -31,7 +31,7 @@ module.exports = class ForecastCommand extends Command {
|
||||
});
|
||||
if (!body.query.count) return msg.say('Location Not Found.');
|
||||
const forecasts = body.query.results.channel.item.forecast;
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x0000FF)
|
||||
.setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png')
|
||||
.setURL(body.query.results.channel.link)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const moment = require('moment');
|
||||
const { GITHUB_LOGIN } = process.env;
|
||||
@@ -27,7 +27,7 @@ module.exports = class GithubCommand extends Command {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get(`https://${GITHUB_LOGIN}@api.github.com/repos/${repo}`);
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xFFFFFF)
|
||||
.setAuthor('Github', 'https://i.imgur.com/ajcPgJG.png')
|
||||
.setURL(body.html_url)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { cleanXML } = require('../../structures/Util');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -32,7 +32,7 @@ module.exports = class MangaCommand extends Command {
|
||||
.query({ q: query });
|
||||
const { manga } = await xml.parseStringAsync(text);
|
||||
const synopsis = cleanXML(manga.entry[0].synopsis[0].substr(0, 2000));
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x2D54A2)
|
||||
.setAuthor('My Anime List', 'https://i.imgur.com/R4bmNFz.png')
|
||||
.setURL(`https://myanimelist.net/manga/${manga.entry[0].id[0]}`)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { OSU_KEY } = process.env;
|
||||
|
||||
@@ -31,7 +31,7 @@ module.exports = class OsuCommand extends Command {
|
||||
type: 'string'
|
||||
});
|
||||
if (!body.length) return msg.say('No Results.');
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xFF66AA)
|
||||
.setAuthor('osu!', 'https://i.imgur.com/EmnUp00.png')
|
||||
.setURL('https://osu.ppy.sh/')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class RecipeCommand extends Command {
|
||||
@@ -28,7 +28,7 @@ module.exports = class RecipeCommand extends Command {
|
||||
const body = JSON.parse(text);
|
||||
if (!body.results.length) return msg.say('No Results.');
|
||||
const recipe = body.results[Math.floor(Math.random() * body.results.length)];
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xC20000)
|
||||
.setURL(recipe.href)
|
||||
.setTitle(recipe.title)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { SOUNDCLOUD_KEY } = process.env;
|
||||
|
||||
@@ -30,7 +30,7 @@ module.exports = class SoundCloudCommand extends Command {
|
||||
client_id: SOUNDCLOUD_KEY
|
||||
});
|
||||
if (!body.length) return msg.say('No Results.');
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xF15A22)
|
||||
.setAuthor('SoundCloud', 'https://i.imgur.com/lFIz7RU.png')
|
||||
.setTitle(body[0].title)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class UrbanCommand extends Command {
|
||||
@@ -26,7 +26,7 @@ module.exports = class UrbanCommand extends Command {
|
||||
.get('http://api.urbandictionary.com/v0/define')
|
||||
.query({ term: query });
|
||||
if (!body.list.length) return msg.say('No Results.');
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x32A8F0)
|
||||
.setAuthor('Urban Dictionary', 'https://i.imgur.com/fzFuuL7.png')
|
||||
.setURL(body.list[0].permalink)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const moment = require('moment');
|
||||
const { WATTPAD_KEY } = process.env;
|
||||
@@ -32,7 +32,7 @@ module.exports = class WattpadCommand extends Command {
|
||||
})
|
||||
.set({ Authorization: `Basic ${WATTPAD_KEY}` });
|
||||
if (!body.stories.length) return msg.say('No Results.');
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xF89C34)
|
||||
.setAuthor('Wattpad', 'https://i.imgur.com/Rw9vRQB.png')
|
||||
.setURL(body.stories[0].url)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class WeatherCommand extends Command {
|
||||
@@ -29,7 +29,7 @@ module.exports = class WeatherCommand extends Command {
|
||||
format: 'json'
|
||||
});
|
||||
if (!body.query.count) return msg.say('Location Not Found.');
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x0000FF)
|
||||
.setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png')
|
||||
.setURL(body.query.results.channel.link)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class WikipediaCommand extends Command {
|
||||
@@ -35,7 +35,7 @@ module.exports = class WikipediaCommand extends Command {
|
||||
formatversion: 2
|
||||
});
|
||||
if (body.query.pages[0].missing) return msg.say('No Results.');
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xE7E7E7)
|
||||
.setTitle(body.query.pages[0].title)
|
||||
.setAuthor('Wikipedia', 'https://i.imgur.com/a4eeEhh.png')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class XKCDCommand extends Command {
|
||||
@@ -28,7 +28,7 @@ module.exports = class XKCDCommand extends Command {
|
||||
const current = await snekfetch
|
||||
.get('https://xkcd.com/info.0.json');
|
||||
if (type === 'today') {
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${current.body.num} - ${current.body.title}`)
|
||||
.setURL(`https://xkcd.com/${current.body.num}`)
|
||||
.setImage(current.body.img)
|
||||
@@ -38,7 +38,7 @@ module.exports = class XKCDCommand extends Command {
|
||||
const random = Math.floor(Math.random() * current.body.num) + 1;
|
||||
const { body } = await snekfetch
|
||||
.get(`https://xkcd.com/${random}/info.0.json`);
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${body.num} - ${body.title}`)
|
||||
.setURL(`https://xkcd.com/${body.num}`)
|
||||
.setImage(body.img)
|
||||
@@ -49,7 +49,7 @@ module.exports = class XKCDCommand extends Command {
|
||||
if (isNaN(choice) || current.body.num < choice || choice < 1) return msg.say('Invalid Number.');
|
||||
const { body } = await snekfetch
|
||||
.get(`https://xkcd.com/${choice}/info.0.json`);
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${body.num} - ${body.title}`)
|
||||
.setURL(`https://xkcd.com/${body.num}`)
|
||||
.setImage(body.img)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { GOOGLE_KEY } = process.env;
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = class YouTubeCommand extends Command {
|
||||
key: GOOGLE_KEY
|
||||
});
|
||||
if (!body.items.length) return msg.say('No Results.');
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xDD2825)
|
||||
.setTitle(body.items[0].snippet.title)
|
||||
.setDescription(body.items[0].snippet.description)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class YuGiOhCommand extends Command {
|
||||
@@ -26,7 +26,7 @@ module.exports = class YuGiOhCommand extends Command {
|
||||
const { body } = await snekfetch
|
||||
.get(`http://yugiohprices.com/api/card_data/${query}`);
|
||||
if (body.status === 'fail') return msg.say('No Results.');
|
||||
const embed = new RichEmbed()
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xBE5F1F)
|
||||
.setTitle(body.data.name)
|
||||
.setDescription(body.data.text)
|
||||
|
||||
Reference in New Issue
Block a user