AI Food and Artwork

This commit is contained in:
Dragon Fire
2020-06-09 14:18:34 -04:00
parent 06fe2a0f49
commit f9612f0393
5 changed files with 71 additions and 3 deletions
+7 -1
View File
@@ -226,7 +226,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 467
Total: 469
### Utility:
@@ -323,6 +323,8 @@ Total: 467
### Random Image:
* **ai-artwork:** Responds with randomly generated artwork.
* **ai-food:** Responds with a randomly generated food.
* **ai-fursona:** Responds with a randomly generated fursona.
* **ai-person:** Responds with a randomly generated person.
* **ai-waifu:** Responds with a randomly generated waifu.
@@ -1399,10 +1401,14 @@ here.
* newspaper (API)
- [The Onion](https://www.theonion.com/)
* the-onion ([RSS Feed](https://www.theonion.com/rss))
- [This Artwork Does Not Exist](https://thisartworkdoesnotexist.com/)
* ai-artwork (API)
- [This Fursona Does Not Exist](https://thisfursonadoesnotexist.com/)
* ai-fursona (API)
- [This Person Does Not Exist](https://thispersondoesnotexist.com/)
* ai-person (API)
- [This Snack Does Not Exist](https://thissnackdoesnotexist.com/)
* ai-food (API)
- [This Waifu Does Not Exist](https://www.thiswaifudoesnotexist.net/)
* ai-waifu (API)
- [Tim's Printables](https://www.timvandevall.com/)
+27
View File
@@ -0,0 +1,27 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
module.exports = class AiArtworkCommand extends Command {
constructor(client) {
super(client, {
name: 'ai-artwork',
aliases: ['this-artwork-does-not-exist', 'art', 'artwork', 'ai-art', 'this-art-does-not-exist'],
group: 'random-img',
memberName: 'ai-artwork',
description: 'Responds with randomly generated artwork.',
clientPermissions: ['ATTACH_FILES'],
credit: [
{
name: 'This Artwork Does Not Exist',
url: 'https://thisartworkdoesnotexist.com/',
reason: 'API'
}
]
});
}
async run(msg) {
const { body } = await request.get('https://thisartworkdoesnotexist.com/artwork');
return msg.say('AI-Generated Artwork', { files: [{ attachment: body, name: 'ai-artwork.jpg' }] });
}
};
+35
View File
@@ -0,0 +1,35 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
const cheerio = require('cheerio');
module.exports = class AiFoodCommand extends Command {
constructor(client) {
super(client, {
name: 'ai-food',
aliases: ['this-food-does-not-exist', 'this-snack-does-not-exist', 'ai-snack', 'food', 'snack'],
group: 'random-img',
memberName: 'ai-food',
description: 'Responds with a randomly generated food.',
nsfw: true,
credit: [
{
name: 'This Snack Does Not Exist',
url: 'https://thissnackdoesnotexist.com/',
reason: 'API'
}
]
});
}
async run(msg) {
try {
const { text } = await request.get('https://thissnackdoesnotexist.com/');
const $ = cheerio.load(text);
const img = $('div[class="Absolute-Center"]').first().attr('style').match(/background-image:url\((.+)\);/i)[1];
const name = $('h1[class="snack-description"]').first().text();
return msg.say(`AI-Generated Food: ${name}`, { files: [{ attachment: img, name: 'ai-food.jpg' }] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+1 -1
View File
@@ -22,6 +22,6 @@ module.exports = class AiPersonCommand extends Command {
async run(msg) {
const { body } = await request.get('https://thispersondoesnotexist.com/image');
return msg.say('AI-Generated Person', { files: [{ attachment: body, name: 'this-person-does-not-exist.jpg' }] });
return msg.say('AI-Generated Person', { files: [{ attachment: body, name: 'ai-person.jpg' }] });
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "116.11.1",
"version": "116.12.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {