mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Remove non-working commands
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class AdorableCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'adorable',
|
||||
aliases: ['adorable-avatar'],
|
||||
group: 'random-seed',
|
||||
memberName: 'adorable',
|
||||
description: 'Creates an adorable avatar based on the text you provide.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
credit: [
|
||||
{
|
||||
name: 'Adorable Avatars',
|
||||
url: 'http://avatars.adorable.io/',
|
||||
reason: 'Original API'
|
||||
},
|
||||
{
|
||||
name: 'gfauchart',
|
||||
url: 'https://github.com/gfauchart',
|
||||
reason: 'API',
|
||||
reasonURL: 'https://github.com/adorableio/avatars-api-middleware/issues/108'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text should be used for generation?',
|
||||
type: 'string',
|
||||
parse: text => encodeURIComponent(text)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { text }) {
|
||||
try {
|
||||
const { body } = await request.get(`https://api.hello-avatar.com/adorables/285/${text}.png`);
|
||||
return msg.say({ files: [{ attachment: body, name: 'adorable.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,70 +0,0 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const request = require('node-superfetch');
|
||||
const { createCanvas, loadImage } = require('canvas');
|
||||
const { list } = require('../../util/Util');
|
||||
const emotions = ['happy', 'sad', 'surprised'];
|
||||
|
||||
module.exports = class DicebearCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'dicebear',
|
||||
aliases: ['dicebear-avatar'],
|
||||
group: 'random-seed',
|
||||
memberName: 'dicebear',
|
||||
description: 'Creates a DiceBear avatar based on the text you provide.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
throttling: {
|
||||
usages: 2,
|
||||
duration: 10
|
||||
},
|
||||
credit: [
|
||||
{
|
||||
name: 'DiceBear Avatars',
|
||||
url: 'https://avatars.dicebear.com/',
|
||||
reason: 'API'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'gender',
|
||||
prompt: 'What gender do you want to use? Either male or female.',
|
||||
type: 'string',
|
||||
oneOf: ['male', 'female'],
|
||||
parse: gender => gender.toLowerCase()
|
||||
},
|
||||
{
|
||||
key: 'emotion',
|
||||
prompt: `What emotion should the avatar display? Either ${list(emotions, 'or')}.`,
|
||||
type: 'string',
|
||||
oneOf: emotions,
|
||||
parse: emotion => emotion.toLowerCase()
|
||||
},
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text should be used for generation?',
|
||||
type: 'string',
|
||||
parse: text => encodeURIComponent(text)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { gender, emotion, text }) {
|
||||
try {
|
||||
const { body } = await request
|
||||
.get(`https://avatars.dicebear.com/api/${gender}/${text}.svg`)
|
||||
.query({
|
||||
width: 285,
|
||||
height: 285,
|
||||
'mood[]': emotion
|
||||
});
|
||||
const canvas = createCanvas(285, 285);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const img = await loadImage(body);
|
||||
ctx.drawImage(img, 0, 0, 285, 285);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'dicebear.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,38 +0,0 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class RobohashCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'robohash',
|
||||
group: 'random-seed',
|
||||
memberName: 'robohash',
|
||||
description: 'Creates a robot based on the text you provide.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
credit: [
|
||||
{
|
||||
name: 'RoboHash',
|
||||
url: 'https://robohash.org/',
|
||||
reason: 'API'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text should be used for generation?',
|
||||
type: 'string',
|
||||
parse: text => encodeURIComponent(text)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { text }) {
|
||||
try {
|
||||
const { body } = await request.get(`https://robohash.org/${text}`);
|
||||
return msg.say({ files: [{ attachment: body, name: 'robohash.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user