Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Image attachment in Discord stopped working #711

Open
kennethjiang opened this issue Nov 6, 2022 · 2 comments
Open

[BUG] Image attachment in Discord stopped working #711

kennethjiang opened this issue Nov 6, 2022 · 2 comments

Comments

@kennethjiang
Copy link
Contributor

It looks like some subtle change in Discord API that has broke the image attachment function.

Steps to reproduce:

from discord_webhook import DiscordWebhook, DiscordEmbed
webhook = DiscordWebhook(url='your discord webhook url')
embed = DiscordEmbed(title='Your Title', description='Lorem ipsum dolor sit', color='03b2f8')
embed.set_image(url='https://app-stg.obico.io/ent/object_store/?t=0/tsd-pics/snapshots/244/1667691350.71139_rotated.jpg&d=48dd0bffee71c77327a9d36374c1332e&ts=1667691350.7235715')
response = webhook.execute()

The message sent won't have the image.

If

embed.set_image(url='https://app-stg.obico.io/ent/object_store/?t=0/tsd-pics/snapshots/244/1667691350.71139_rotated.jpg&d=48dd0bffee71c77327a9d36374c1332e&ts=1667691350.7235715')

is changed to a simpler image url, such as

embed.set_image(url='https://obico.io/img/favicon.png')

the message will have the image correctly attached.

My best guess is some recent change in Discord API has broken its previous behavior. This looks more like a bug in Discord API, so we could just wait it out until Discord fixes it. But it's also possible that it's a "feature" by their design.

Help wanted as we don't have time to dig much deeper atm.

@mcstoufer
Copy link

If the resolution of the content is client side, then this should be an easy fix. If that URL is being passed up the Discord endpoint and processed there, there may be some XSS checks that squelch the execution of the parameterized URL. Or it could be something as silly as not finding the URL ending with a valid image file extension.
I'll see what I can dig into on the client lib.

@pilonull
Copy link

Would love to have image snippets in my obico discord notifications, that would be awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants