Apple Engraving Command

This commit is contained in:
Dragon Fire
2020-03-15 19:24:15 -04:00
parent 4cea5ed6db
commit 45d99929ee
4 changed files with 66 additions and 2 deletions
+3 -1
View File
@@ -118,7 +118,7 @@ don't grant that permission.
## Commands
Total: 367
Total: 368
### Utility:
@@ -373,6 +373,7 @@ Total: 367
### Image Manipulation:
* **achievement:** Sends a Minecraft achievement with the text of your choice.
* **apple-engraving:** Engraves the text of your choice onto an Apple product.
* **approved:** Draws an "approved" stamp over an image or a user's avatar.
* **brazzers:** Draws an image with the Brazzers logo in the corner. (NSFW)
* **circle:** Draws an image or a user's avatar as a circle.
@@ -580,6 +581,7 @@ here.
- [Antonio Guillem](http://antonioguillem.com/)
* distracted-boyfriend ([Image](https://www.istockphoto.com/photo/gm493656728-77018851))
- [Apple](https://www.apple.com/)
* apple-engraving (API)
* itunes ([iTunes Search API](https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/))
- [astrology.TV](https://astrology.tv/)
* horoscope ([Horoscope Data](https://astrology.tv/horoscope/daily/))
+10
View File
@@ -0,0 +1,10 @@
{
"airpods": "PRXJ2AM",
"airpods-pro": "PWP22AM",
"pencil": "PU8F2AM",
"ipod": "PVHV2LL",
"ipad-pro": "PTEM2LL",
"ipad": "PW752LL",
"ipad-mini": "PUQX2LL",
"ipad-air": "PUUK2LL"
}
+52
View File
@@ -0,0 +1,52 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
const { list } = require('../../util/Util');
const products = require('../../assets/json/apple-engraving');
module.exports = class AppleEngravingCommand extends Command {
constructor(client) {
super(client, {
name: 'apple-engraving',
aliases: ['apple-engrave', 'apple-e', 'a-engrave', 'a-engraving'],
group: 'image-edit',
memberName: 'apple-engraving',
description: 'Engraves the text of your choice onto an Apple product.',
credit: [
{
name: 'Apple',
url: 'https://www.apple.com/',
reason: 'API'
}
],
args: [
{
key: 'product',
prompt: `What product do you want to engrave? Either ${list(Object.keys(products), 'or')}.`,
type: 'string',
oneOf: Object.keys(products),
parse: product => product.toLowerCase()
},
{
key: 'text',
prompt: 'What text do you want to engrave?',
type: 'string'
}
]
});
}
async run(msg, { product, text }) {
try {
const { body } = await request
.get(`https://www.apple.com/shop/preview/engrave/${products[product]}/A`)
.query({
th: text,
s: 2,
f: 'font1'
});
return msg.channel.send({ files: [{ attachment: body, name: 'apple-engraving.jpg' }] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "112.7.2",
"version": "112.8.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {