mrmBot-Matrix/commands/mc.js

15 lines
583 B
JavaScript
Raw Normal View History

2019-09-13 20:02:41 +00:00
const fetch = require("node-fetch");
exports.run = async (message, args) => {
if (args.length === 0) return `${message.author.mention}, you need to provide some text to generate a Minecraft achievement!`;
message.channel.sendTyping();
const request = await fetch(`https://www.minecraftskinstealer.com/achievement/a.php?i=13&h=Achievement+get%21&t=${encodeURIComponent(args.join("+"))}`);
2019-09-13 20:02:41 +00:00
const buffer = await request.buffer();
return message.channel.createMessage("", {
file: buffer,
name: "mc.png"
});
};
exports.aliases = ["ach", "achievement", "minecraft"];