mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 15:57:43 +02:00
LOGOS :(
This commit is contained in:
@@ -36,6 +36,7 @@ module.exports = class HoroscopeCommand extends Command {
|
|||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0x9797FF)
|
.setColor(0x9797FF)
|
||||||
.setTitle(`Horoscope for ${body.sunsign}...`)
|
.setTitle(`Horoscope for ${body.sunsign}...`)
|
||||||
|
.setURL('https://new.theastrologer.com/horoscopes/')
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setDescription(body.horoscope)
|
.setDescription(body.horoscope)
|
||||||
.addField('❯ Mood',
|
.addField('❯ Mood',
|
||||||
|
|||||||
@@ -21,9 +21,11 @@ module.exports = class WordOfTheDayCommand extends Command {
|
|||||||
.get('http://api.wordnik.com/v4/words.json/wordOfTheDay')
|
.get('http://api.wordnik.com/v4/words.json/wordOfTheDay')
|
||||||
.query({ api_key: WORDNIK_KEY });
|
.query({ api_key: WORDNIK_KEY });
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0x9797FF)
|
.setAuthor('Wordnik', 'https://i.imgur.com/VcLZLXn.jpg')
|
||||||
|
.setColor(0xFE6F11)
|
||||||
.setTitle(body.word)
|
.setTitle(body.word)
|
||||||
.setDescription(`(${body.definitions[0].partOfSpeech}) ${body.definitions[0].text}`);
|
.setURL('http://wordnik.com/word-of-the-day')
|
||||||
|
.setDescription(`(${body.definitions[0].partOfSpeech || 'N/A'}) ${body.definitions[0].text}`);
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ module.exports = class BotInfoCommand extends Command {
|
|||||||
const { body } = await snekfetch
|
const { body } = await snekfetch
|
||||||
.get(`https://bots.discord.pw/api/bots/${bot.id}`)
|
.get(`https://bots.discord.pw/api/bots/${bot.id}`)
|
||||||
.set({ Authorization: DBOTS_KEY });
|
.set({ Authorization: DBOTS_KEY });
|
||||||
|
const owners = [];
|
||||||
|
for (const owner of body.owner_ids) {
|
||||||
|
const user = await this.client.users.fetch(owner);
|
||||||
|
owners.push(user.tag);
|
||||||
|
}
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0x9797FF)
|
.setColor(0x9797FF)
|
||||||
.setAuthor('Discord Bots', 'https://i.imgur.com/tHTKaks.jpg')
|
.setAuthor('Discord Bots', 'https://i.imgur.com/tHTKaks.jpg')
|
||||||
@@ -38,7 +43,9 @@ module.exports = class BotInfoCommand extends Command {
|
|||||||
.addField('❯ Invite',
|
.addField('❯ Invite',
|
||||||
`[Here](${body.invite_url})`, true)
|
`[Here](${body.invite_url})`, true)
|
||||||
.addField('❯ Prefix',
|
.addField('❯ Prefix',
|
||||||
body.prefix, true);
|
body.prefix, true)
|
||||||
|
.addField('❯ Owner(s)',
|
||||||
|
owners.join(', '), true);
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.status === 404) return msg.say('Could not find any results.');
|
if (err.status === 404) return msg.say('Could not find any results.');
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ module.exports = class BulbapediaCommand extends Command {
|
|||||||
.setTitle(data.title)
|
.setTitle(data.title)
|
||||||
.setAuthor('Bulbapedia', 'https://i.imgur.com/ePpoeFA.png')
|
.setAuthor('Bulbapedia', 'https://i.imgur.com/ePpoeFA.png')
|
||||||
.setThumbnail(data.thumbnail ? data.thumbnail.source : null)
|
.setThumbnail(data.thumbnail ? data.thumbnail.source : null)
|
||||||
|
.setURL(`https://bulbapedia.bulbagarden.net/wiki/${query.replace(/\)/gi, '%29')}`)
|
||||||
.setDescription(shorten(data.extract.replace(/\n/g, '\n\n')));
|
.setDescription(shorten(data.extract.replace(/\n/g, '\n\n')));
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
|
const { MessageEmbed } = require('discord.js');
|
||||||
const snekfetch = require('snekfetch');
|
const snekfetch = require('snekfetch');
|
||||||
|
const { shorten } = require('../../structures/Util');
|
||||||
|
|
||||||
module.exports = class DerpibooruCommand extends Command {
|
module.exports = class DerpibooruCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -9,6 +11,7 @@ module.exports = class DerpibooruCommand extends Command {
|
|||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'derpibooru',
|
memberName: 'derpibooru',
|
||||||
description: 'Searches Derpibooru for your query.',
|
description: 'Searches Derpibooru for your query.',
|
||||||
|
clientPermissions: ['EMBED_LINKS'],
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'query',
|
key: 'query',
|
||||||
@@ -33,7 +36,18 @@ module.exports = class DerpibooruCommand extends Command {
|
|||||||
if (!msg.channel.nsfw && body.tags.includes('suggestive')) {
|
if (!msg.channel.nsfw && body.tags.includes('suggestive')) {
|
||||||
return msg.say('This image is only viewable in NSFW channels.');
|
return msg.say('This image is only viewable in NSFW channels.');
|
||||||
}
|
}
|
||||||
return msg.say(`https:${body.representations.large}`);
|
const embed = new MessageEmbed()
|
||||||
|
.setAuthor('Derpibooru', 'https://i.imgur.com/cptnecp.png')
|
||||||
|
.setColor(0xC6D2E1)
|
||||||
|
.setURL(`https://derpibooru.org/images/${body.id}`)
|
||||||
|
.setImage(`https:${body.representations.medium}`)
|
||||||
|
.addField('❯ Uploader',
|
||||||
|
body.uploader, true)
|
||||||
|
.addField('❯ Upload Date',
|
||||||
|
new Date(body.created_at).toDateString(), true)
|
||||||
|
.addField('❯ Tags',
|
||||||
|
shorten(body.tags, 1000));
|
||||||
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,11 @@ module.exports = class DictionaryCommand extends Command {
|
|||||||
if (!body.length) return msg.say('Could not find any results.');
|
if (!body.length) return msg.say('Could not find any results.');
|
||||||
const data = body[0];
|
const data = body[0];
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0x9797FF)
|
.setAuthor('Wordnik', 'https://i.imgur.com/VcLZLXn.jpg')
|
||||||
|
.setColor(0xFE6F11)
|
||||||
.setTitle(data.word)
|
.setTitle(data.word)
|
||||||
.setDescription(`(${data.partOfSpeech}) ${data.text}`);
|
.setURL(`http://wordnik.com/words/${query}#define`)
|
||||||
|
.setDescription(`(${data.partOfSpeech || 'N/A'}) ${data.text}`);
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
|
const { MessageEmbed } = require('discord.js');
|
||||||
const snekfetch = require('snekfetch');
|
const snekfetch = require('snekfetch');
|
||||||
const { FLICKR_KEY } = process.env;
|
const { FLICKR_KEY } = process.env;
|
||||||
|
|
||||||
@@ -10,6 +11,7 @@ module.exports = class FlickrCommand extends Command {
|
|||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'flickr',
|
memberName: 'flickr',
|
||||||
description: 'Searches Flickr for your query.',
|
description: 'Searches Flickr for your query.',
|
||||||
|
clientPermissions: ['EMBED_LINKS'],
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'query',
|
key: 'query',
|
||||||
@@ -32,8 +34,14 @@ module.exports = class FlickrCommand extends Command {
|
|||||||
nojsoncallback: true
|
nojsoncallback: true
|
||||||
});
|
});
|
||||||
if (!body.photos.photo.length) return msg.say('Could not find any results.');
|
if (!body.photos.photo.length) return msg.say('Could not find any results.');
|
||||||
const photo = body.photos.photo[Math.floor(Math.random() * body.photos.photo.length)];
|
const data = body.photos.photo[Math.floor(Math.random() * body.photos.photo.length)];
|
||||||
return msg.say(`https://farm${photo.farm}.staticflickr.com/${photo.server}/${photo.id}_${photo.secret}.jpg`);
|
const embed = new MessageEmbed()
|
||||||
|
.setAuthor('Flickr', 'https://i.imgur.com/8QPPlV9.png')
|
||||||
|
.setColor(0x0059D4)
|
||||||
|
.setImage(`https://farm${data.farm}.staticflickr.com/${data.server}/${data.id}_${data.secret}.jpg`)
|
||||||
|
.setTitle(data.title)
|
||||||
|
.setURL(`https://www.flickr.com/photos/${data.owner}/${data.id}`);
|
||||||
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
|
const { MessageEmbed } = require('discord.js');
|
||||||
const snekfetch = require('snekfetch');
|
const snekfetch = require('snekfetch');
|
||||||
const { GIPHY_KEY } = process.env;
|
const { GIPHY_KEY } = process.env;
|
||||||
|
|
||||||
@@ -10,6 +11,7 @@ module.exports = class GiphyCommand extends Command {
|
|||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'giphy',
|
memberName: 'giphy',
|
||||||
description: 'Searches Giphy for your query.',
|
description: 'Searches Giphy for your query.',
|
||||||
|
clientPermissions: ['EMBED_LINKS'],
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'query',
|
key: 'query',
|
||||||
@@ -30,7 +32,17 @@ module.exports = class GiphyCommand extends Command {
|
|||||||
rating: msg.channel.nsfw ? 'r' : 'pg'
|
rating: msg.channel.nsfw ? 'r' : 'pg'
|
||||||
});
|
});
|
||||||
if (!body.data.length) return msg.say('Could not find any results.');
|
if (!body.data.length) return msg.say('Could not find any results.');
|
||||||
return msg.say(body.data[Math.floor(Math.random() * body.data.length)].images.original.url);
|
const data = body.data[Math.floor(Math.random() * body.data.length)];
|
||||||
|
const embed = new MessageEmbed()
|
||||||
|
.setAuthor('Giphy', 'https://i.imgur.com/rWphUCU.jpg')
|
||||||
|
.setColor(0x4C177F)
|
||||||
|
.setURL(data.url)
|
||||||
|
.setImage(data.images.original.url.replace(/\?fingerprint=.+/gi, ''))
|
||||||
|
.addField('❯ Uploader',
|
||||||
|
data.username || 'N/A', true)
|
||||||
|
.addField('❯ Upload Date',
|
||||||
|
new Date(data.import_datetime).toDateString(), true);
|
||||||
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,10 @@ module.exports = class JishoCommand extends Command {
|
|||||||
if (!body.data.length) return msg.say('Could not find any results.');
|
if (!body.data.length) return msg.say('Could not find any results.');
|
||||||
const data = body.data[0];
|
const data = body.data[0];
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0x9797FF)
|
.setAuthor('Jisho', 'https://i.imgur.com/CBJZe2m.png')
|
||||||
|
.setColor(0x0BC510)
|
||||||
.setTitle(data.japanese[0].word)
|
.setTitle(data.japanese[0].word)
|
||||||
|
.setURL(`http://jisho.org/word/${data.japanese[0].word}`)
|
||||||
.setDescription(data.senses[0].english_definitions.join(', '));
|
.setDescription(data.senses[0].english_definitions.join(', '));
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ module.exports = class RecipeCommand extends Command {
|
|||||||
if (!body.results.length) return msg.say('Could not find any results.');
|
if (!body.results.length) return msg.say('Could not find any results.');
|
||||||
const recipe = body.results[Math.floor(Math.random() * body.results.length)];
|
const recipe = body.results[Math.floor(Math.random() * body.results.length)];
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
|
.setAuthor('Recipe Puppy', 'https://i.imgur.com/mn05Z8y.png')
|
||||||
.setColor(0xC20000)
|
.setColor(0xC20000)
|
||||||
.setURL(recipe.href)
|
.setURL(recipe.href)
|
||||||
.setTitle(recipe.title)
|
.setTitle(recipe.title)
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
|
const { MessageEmbed } = require('discord.js');
|
||||||
const snekfetch = require('snekfetch');
|
const snekfetch = require('snekfetch');
|
||||||
const { xml2js } = require('xml-js');
|
const { xml2js } = require('xml-js');
|
||||||
const { stripIndents } = require('common-tags');
|
const { shorten } = require('../../structures/Util');
|
||||||
|
const ratings = {
|
||||||
|
s: 'Safe',
|
||||||
|
q: 'Questionable'
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = class SafebooruCommand extends Command {
|
module.exports = class SafebooruCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -11,6 +16,7 @@ module.exports = class SafebooruCommand extends Command {
|
|||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'safebooru',
|
memberName: 'safebooru',
|
||||||
description: 'Searches Safebooru for your query.',
|
description: 'Searches Safebooru for your query.',
|
||||||
|
clientPermissions: ['EMBED_LINKS'],
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'query',
|
key: 'query',
|
||||||
@@ -36,10 +42,19 @@ module.exports = class SafebooruCommand extends Command {
|
|||||||
if (parsed._attributes.count === '0' || !parsed.post.length) return msg.say('Could not find any results.');
|
if (parsed._attributes.count === '0' || !parsed.post.length) return msg.say('Could not find any results.');
|
||||||
const posts = msg.channel.nsfw ? parsed.post : parsed.post.filter(post => post._attributes.rating === 's');
|
const posts = msg.channel.nsfw ? parsed.post : parsed.post.filter(post => post._attributes.rating === 's');
|
||||||
if (!posts.length) return msg.say('Could not find any results.');
|
if (!posts.length) return msg.say('Could not find any results.');
|
||||||
return msg.say(stripIndents`
|
const data = posts[Math.floor(Math.random() * posts.length)]._attributes;
|
||||||
${query ? `Results for ${query}:` : 'Random Image:'}
|
const embed = new MessageEmbed()
|
||||||
https:${posts[Math.floor(Math.random() * posts.length)]._attributes.file_url}
|
.setAuthor('Safebooru', 'https://i.imgur.com/iGMNwhf.jpg')
|
||||||
`);
|
.setColor(0xC6D2E1)
|
||||||
|
.setURL(`http://safebooru.org/index.php?page=post&s=view&id=${data.id}`)
|
||||||
|
.setImage(`https:${data.file_url}`)
|
||||||
|
.addField('❯ Upload Date',
|
||||||
|
new Date(data.created_at).toDateString(), true)
|
||||||
|
.addField('❯ Rating',
|
||||||
|
ratings[data.rating], true)
|
||||||
|
.addField('❯ Tags',
|
||||||
|
shorten(data.tags, 1000));
|
||||||
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,10 @@ module.exports = class ThesaurusCommand extends Command {
|
|||||||
const synonyms = body.find(i => i.relationshipType === 'synonym');
|
const synonyms = body.find(i => i.relationshipType === 'synonym');
|
||||||
const antonyms = body.find(i => i.relationshipType === 'antonym');
|
const antonyms = body.find(i => i.relationshipType === 'antonym');
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0x9797FF)
|
.setAuthor('Wordnik', 'https://i.imgur.com/VcLZLXn.jpg')
|
||||||
|
.setColor(0xFE6F11)
|
||||||
.setTitle(query)
|
.setTitle(query)
|
||||||
|
.setURL(`http://wordnik.com/words/${query}#relate`)
|
||||||
.addField('❯ Synonyms',
|
.addField('❯ Synonyms',
|
||||||
synonyms ? synonyms.words.join(', ') : 'N/A')
|
synonyms ? synonyms.words.join(', ') : 'N/A')
|
||||||
.addField('❯ Antonyms',
|
.addField('❯ Antonyms',
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ module.exports = class WeatherCommand extends Command {
|
|||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0xFF7A09)
|
.setColor(0xFF7A09)
|
||||||
.setAuthor('OpenWeatherMap', 'https://i.imgur.com/tUd1MYB.png')
|
.setAuthor('OpenWeatherMap', 'https://i.imgur.com/tUd1MYB.png')
|
||||||
|
.setURL(`https://openweathermap.org/city/${body.id}`)
|
||||||
.setThumbnail(body.weather[0].icon ? `http://openweathermap.org/img/w/${body.weather[0].icon}.png` : null)
|
.setThumbnail(body.weather[0].icon ? `http://openweathermap.org/img/w/${body.weather[0].icon}.png` : null)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.addField('❯ City',
|
.addField('❯ City',
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ module.exports = class WikipediaCommand extends Command {
|
|||||||
.setTitle(data.title)
|
.setTitle(data.title)
|
||||||
.setAuthor('Wikipedia', 'https://i.imgur.com/Z7NJBK2.png')
|
.setAuthor('Wikipedia', 'https://i.imgur.com/Z7NJBK2.png')
|
||||||
.setThumbnail(data.thumbnail ? data.thumbnail.source : null)
|
.setThumbnail(data.thumbnail ? data.thumbnail.source : null)
|
||||||
|
.setURL(`https://en.wikipedia.org/wiki/${query.replace(/\)/gi, '%29')}`)
|
||||||
.setDescription(shorten(data.extract.replace(/\n/g, '\n\n')));
|
.setDescription(shorten(data.extract.replace(/\n/g, '\n\n')));
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ module.exports = class TranslateCommand extends Command {
|
|||||||
});
|
});
|
||||||
const lang = body.lang.split('-');
|
const lang = body.lang.split('-');
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0x00AE86)
|
.setAuthor('Yandex', 'https://i.imgur.com/HMpH9sq.png')
|
||||||
|
.setColor(0xFF0000)
|
||||||
.addField(`❯ From: ${codes[lang[0]]}`,
|
.addField(`❯ From: ${codes[lang[0]]}`,
|
||||||
text)
|
text)
|
||||||
.addField(`❯ To: ${codes[lang[1]]}`,
|
.addField(`❯ To: ${codes[lang[1]]}`,
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "42.14.0",
|
"version": "42.14.2",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Shard.js",
|
"main": "Shard.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user