πŸ–₯
Sample Code
Sample code for how to implement in your website.

HTML

index.html
1
<img src="https://api.mineatar.io/body/MHF_Steve?scale=4" alt="Steve's Body" />
Copied!

React

components/PlayerBody.js
1
import React from 'react';
2
import PropTypes from 'prop-types';
3
​
4
export default function PlayerBody({ username, scale }) {
5
return (
6
<img src={`https://api.mineatar.io/body/${username}?scale=${scale}`} alt={`${username}'s Body`} />
7
);
8
}
9
​
10
PlayerBody.propTypes = {
11
username: PropTypes.string.isRequired,
12
scale: PropTypes.number
13
};
14
​
15
PlayerBody.defaultProps = {
16
scale: 4
17
};
Copied!

Discord.js Embed

commands/body.js
1
const { MessageEmbed } = require('discord.js');
2
​
3
// The following code will need to be placed within your message create
4
// event handler. This will send the embed to the channel within the
5
// `channel` variable.
6
​
7
const exampleEmbed = new MessageEmbed()
8
.setTitle('Steve\'s Skin')
9
.setColor(3066993)
10
.setImage('https://api.mineatar.io/body/MHF_Steve?scale=4');
11
​
12
channel.send({ embeds: [exampleEmbed] });
Copied!
Copy link
Edit on GitHub