Discord.py: Cannot use shortned URLs to set image in embed

Created on 12 Jun 2019  路  6Comments  路  Source: Rapptz/discord.py

Summary

Cannot use shortened links (like from https://u.nu) to set image in an embed.

Since the shortened link is just a redirect, ideally it should set the image.

Reproduction Steps

embed = discord.Embed()
embed.set_image(url=f'https://u.nu/sholay-{result}')
await ctx.send(embed=embed)

Expected Results

Embed should have been sent.

Actual Results

Embed not sent. No traceback.

Checklist

  • [x] I have searched the open issues for duplicates.
  • [x] I have shown the entire traceback, if possible.
  • [x] I have removed my token from display, if visible.

System Information


  • Python v3.6.8-final
  • discord.py v1.2.2-final
  • aiohttp v3.5.4
  • websockets v6.0
  • system info: Linux 4.4.0-17763-Microsoft #379-Microsoft Wed Mar 06 19:16:00 PST 2019
invalid question

All 6 comments

I copied your code exactly, created a shortened URL to a direct image link, and it worked just fine for me.

馃槷 But it didn't work for me... The original link works fine, but not the shortened link (in this case, u.nu)

Note a couple things here:
1) This library does nothing to render the image, that is 100% on discord's side. If there is a failure to parse an image, there's nothing this library can do
2) The embed not sending makes it seem like there's probably an error in your URL, otherwise you have some issue completely somewhere else unrelated to this. If your URL is malformed, you'll receive an error when trying to send.

Due to these...I would recommend joining the help server, as no matter what the issue is here, it's not on this library's side and nothing can be done here to "fix" this.

Hmmm, maybe I should have been more specific.

I was using format strings in the url parameter. I just tried out, the URL works but when I use the format string, it won't work. (Edited the issue description accordingly)

This doesn't seem like a library problem.

the URL parameter doesn't parse the format string. I used a variable with the same thing and it worked correctly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Be4Vision picture Be4Vision  路  3Comments

superloach picture superloach  路  3Comments

Nicba1010 picture Nicba1010  路  3Comments

danshat picture danshat  路  3Comments

PicklesJars picture PicklesJars  路  3Comments