-
I'd like the preface this I am new to making Discord bots as well as unexperienced in python. I only started this adventure in python because it was the first result to pop up when looking how to make Discord Bots. I have been trying to find a way to have a second image displaying in an embed object. My initial searches set for how to 'Create my own Custom Embed' lead me no where. Just more tutorials on how to use the existing Embed. So I decided to look at this Github for Embeds.py source code. What I basically did was anywhere 'image' was mentioned, I copied and pasted it as 'imageTwo'. So I now have an 'ImageTwo' property in my local copy of 'Embeds.py'. When I use the 'ImageTwo' methods there is no problem such as:
However, when the embed is displayed, I don't see the second image. But if I print it, I can see the second URL.
At this point, since there are no explicit errors I am assuming I am on the right track but I guess I don't know how the embed.image is 'displayed'. Could they be displaying over one another? Where else would I have to make changes for 'ImageTwo'? Or is there anyway I can control how the image is displayed? Maybe right-align or left-align it? Or only make it take up half the width of the Embed Message? In my search I came across something like this for discord.js instead of discord.py. I am not sure if this was someone's custom code or the actual source code.
If the Embed Image is displayed that easily, then I could do something like this to get the result I want:
Any help would be great, but I would hate to have to start over in JS/JSX instead of Python, but I will do what I need to. On another note, I don't see discord/types in my discord.py installation. Which is where I did find a types/embed.py file here on GitHub but not locally. That file seems to have class EmbedImage and like I mentioned, I can't find it locally. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This is not possible, this is a discord limitation not discord.py. discord takes the embed as a dict and wont use extra stuff we throw into it. using js or jsx will not help here either. For your sidenote, discord/types is not released yet and is still a work in progress, it will be released in v2.0. |
Beta Was this translation helpful? Give feedback.
-
Discord does not allow multiple images per embeds. Likewise, Discord would not allow you to change their source code to allow multiple images per embeds using JS or JSX. There is a caveat: webhooks can send multiple embeds and the client concatenates multiple embed images into a single embed under certain conditions. For example, the following code given a webhook would allow you to send up to 4 images into a singular UI embed using 4 embed objects: main_embed = discord.Embed(title='Hello', url='http://example.com')
main_embed.set_image(url='http://image.com/1.png')
embeds = [
main_embed,
# These need to have the same URL
discord.Embed(url='http://example.com').set_image(url='http://image.com/2.png'),
discord.Embed(url='http://example.com').set_image(url='http://image.com/3.png'),
discord.Embed(url='http://example.com').set_image(url='http://image.com/4.png'),
]
# Webhook only
await webhook.send(embeds=embeds) However, only webhooks have this ability and it is undocumented on Discord's end. |
Beta Was this translation helpful? Give feedback.
Discord does not allow multiple images per embeds. Likewise, Discord would not allow you to change their source code to allow multiple images per embeds using JS or JSX.
There is a caveat: webhooks can send multiple embeds and the client concatenates multiple embed images into a single embed under certain conditions.
For example, the following code given a webhook would allow you to send up to 4 images into a singular UI embed using 4 embed objects: