discord embed erstellen code example
Example 1: discord.js embed
const exampleEmbed = {
color: 0x0099ff,
title: 'Some title',
url: 'https://discord.js.org',
author: {
name: 'Some name',
icon_url: 'https://i.imgur.com/wSTFkRM.png',
url: 'https://discord.js.org',
},
description: 'Some description here',
thumbnail: {
url: 'https://i.imgur.com/wSTFkRM.png',
},
fields: [
{
name: 'Regular field title',
value: 'Some value here',
},
{
name: '\u200b',
value: '\u200b',
inline: false,
},
{
name: 'Inline field title',
value: 'Some value here',
inline: true,
},
{
name: 'Inline field title',
value: 'Some value here',
inline: true,
},
{
name: 'Inline field title',
value: 'Some value here',
inline: true,
},
],
image: {
url: 'https://i.imgur.com/wSTFkRM.png',
},
timestamp: new Date(),
footer: {
text: 'Some footer text here',
icon_url: 'https://i.imgur.com/wSTFkRM.png',
},
};
message.channel.send({ embed: exampleEmbed });
Example 2: discord.js MessageEmbed
//top of file
const Discord = require('discord.js')
//example (inside of a command)
const embed = new Discord.Message.Embed()
embed.setAuthor(`example`)
embed.setTitle(`example`)
embed.setDescription(`example`)
message.channel.send({embed});
//there are obviously some other add-ons, such as AuthorIcon and URL.