I’m working on a Discord bot and need some help with embed messages. I want to add the bot’s image to the right side of the embed. Here’s what I have so far:
How can I modify this to include the bot’s image? Also, is there a way to mention the user who triggered the command in the embed? Thanks for any help!
I’ve been working with Discord bots for a while, and here’s what I’ve found works well for customizing embeds:
You can use the ‘author’ field to add the bot’s image and name at the top of the embed. It looks cleaner than a thumbnail in my opinion. Also, for mentioning the user, I prefer using ‘footer’ instead of putting it in the description. It keeps the main content focused.
To add the bot’s image and mention the user, you can modify your embed object like this:
const helpEmbed = {
title: 'Bot Commands',
color: 0x3498db,
description: `<@${msg.author.id}>, here are the available commands:\n\n**!info** - Get bot info\n**!stats** - View server stats\n**!role** - Manage roles`,
thumbnail: {
url: client.user.displayAvatarURL()
}
};
The thumbnail property adds the bot’s avatar to the right side. Use client.user.displayAvatarURL() to get the bot’s image URL. To mention the user, include <@${msg.author.id}> in the description.
Remember to replace msg with the appropriate variable name if you’re using a different one in your event listener.