mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 07:46:43 +02:00
42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
const Command = require('../../structures/Command');
|
|
const snekfetch = require('snekfetch');
|
|
|
|
module.exports = class AchievementCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'achievement',
|
|
group: 'image-edit',
|
|
memberName: 'achievement',
|
|
description: 'Sends a Minecraft achievement with the text of your choice.',
|
|
clientPermissions: ['ATTACH_FILES'],
|
|
args: [
|
|
{
|
|
key: 'text',
|
|
prompt: 'What should the text of the achievement be?',
|
|
type: 'string',
|
|
validate: text => {
|
|
if (text.length < 25) return true;
|
|
return 'Invalid text, please keep the text under 25 characters.';
|
|
}
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
async run(msg, { text }) {
|
|
try {
|
|
const { body } = await snekfetch
|
|
.get('https://www.minecraftskinstealer.com/achievement/a.php')
|
|
.query({
|
|
i: 1,
|
|
h: 'Achievement Get!',
|
|
t: text
|
|
});
|
|
return msg.say({ files: [body] });
|
|
} catch (err) {
|
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
|
}
|
|
}
|
|
};
|
|
|