Shows you the information by giving the bot the username. (m!minecraft user <username>) Made by toothless and weird!
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
if (context.params.event.content.startsWith('m!minecraft user')) {
const args = context.params.event.content.split(' ').slice(2);
if (!args.length)
return lib.discord.channels['@0.1.2'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `No arguments provided.`,
});
let info = await lib.http.request['@1.1.5'].get({
url: `https://api.mojang.com/users/profiles/minecraft/${args}`,
});
let nameh = await lib.http.request['@1.1.5'].get({
url: `https://some-random-api.ml/mc?username=${args}`,
});
let message = await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embed: {
type: 'rich',
title: `${nameh.data.username}`,
description: '',
color: 0xb67afb,
fields: [
{
name: `UUID`,
value: `${info.data.id}`,
},
{
name: `Skin`,
value: `[Click here](https://crafatar.com/skins/${info.data.id})`,
},
],
image: {
url: `https://crafatar.com/renders/body/${info.data.id}?size=4&default=MHF_Steve&overlay`,
height: 0,
width: 0,
},
thumbnail: {
url: `
https://crafatar.com/renders/head/${info.data.id}`,
height: 0,
width: 0,
},
author: {
name: `Minecraft Userinfo`,
},
},
});
}