discord / discord-rpc

https://discordapp.com/developers
MIT License
1.06k stars 327 forks source link

Images do not show #21

Closed Aida-Enna closed 6 years ago

Aida-Enna commented 6 years ago

I'm using the example code provided in a C# project and everything is working fine except for the images, both large and small. I've uploaded them to the dashboard and am using the corresponding key (the name I gave the image, that shows up next to it post upload). I've yet to get any of the images to show.

presence.largeImageKey = "lobby";

image

image

Chaosvex commented 6 years ago

Exactly the same issue here. Restarting the client as suggested in https://github.com/discordapp/discord-rpc/issues/14 doesn't help.

Discord isn't even showing the default rich presence artwork so I'm assuming this is something on their side that needs fixed.

Aida-Enna commented 6 years ago

Restarting both discord clients and the program didn't fix the issue, unfortunately.

Chaosvex commented 6 years ago

The pictures eventually decided to join the party but freshly uploaded pictures still don't work. I'm assuming there's a huge delay (6-8 hours?) on uploading pictures and actually being able to make use of them.

YaLTeR commented 6 years ago

Same issue. I guess I'll have to wait.

night commented 6 years ago

This should be fixed now.

If you're still having issues you probably have old cached data. Follow these steps to clear it:

  1. Open Discord console with ctrl + shift + I (cmd + shift + I on macOS)
  2. Go to the Network tab
  3. Toggle "Disable cache"
  4. Refresh the app with ctrl + R (cmd + R on macOS).
  5. Send rich presence containing an asset to confirm it's fixed
Aida-Enna commented 6 years ago

Just came back to this after a long break - My images are still not showing, even after doing the instructions provided by @night. Can anyone else confirm that this is fixed for them? =/

YaLTeR commented 6 years ago

Yeah, the images showed up for me after a couple hours. No idea if anything was done about the long wait since then.

msciotti commented 6 years ago

Did you disable the cache as previously instructed? And is your app up to date?

Aida-Enna commented 6 years ago

Yep, I disabled the cache and I tried the latest versions of Discord and Canary. Would the pictures need to be re-uploaded to work?

msciotti commented 6 years ago

They shouldn't, but as with all things programming related, it never hurts to try it lol

DeepDoge commented 5 years ago

The pictures eventually decided to join the party but freshly uploaded pictures still don't work. I'm assuming there's a huge delay (6-8 hours?) on uploading pictures and actually being able to make use of them.

i know this is an old thread but i need to share this because it was a pain for me

i have a personal youtube and soundcloud rpc and it uploads thumbnails automatically i had the same problem

then realized that the page where you upload assets is using ( https://discordapp.com/api/oauth2/applications/{your app id}/assets ) to get the assets list. it works instantly after you upload the asset you can instantly see it on the list

BUT discord client uses ( https://discordapp.com/api/v6/oauth2/applications/{your app id}/assets ) to get the assets list and it doesn't work instantly all the time im not sure why

im using both. using the first one to get a list of already uploaded assets and using the second one to check if the asset is ready to show on rpc

Lachee commented 5 years ago

uploading of images automatically is technically not supported (since its not documented anywhere) and teeechnically against the ToS. This upload delay is probably a one of the many reasons they havn't opened this endpoint to the public.

As for the V6 part of the URL, that shouldnt change anything as the default API is version 6 at the moment. The reason you can see it instantly is if you are uploading via the page, it has some JS to insert a new element into the list for you.

In short, with the intended use of Rich Presence this is a non-issue sadly.

DeepDoge commented 5 years ago

Well, v6 changing things. and as i said I'm not sure why. And JS has nothing to do with that. I'm talking about direct HTTP requests to the API.

When you update the RPC asset key, discord client asks for an array of assets then finds the id of the asset and uses that id to create that URL ( https://cdn.discordapp.com/app-assets/{app_id}/{asset_id}.png ).

The upload request also returns you the generated id of the asset too. So after uploading the asset, first, I tried to check if its useable by sending a request to URL above. But it works instantly too just like ( https://discordapp.com/api/oauth2/applications/{app_id}/assets ). (reminder I'm talking about HTTP requests)

So after uploading the picture and discord told you its "DONE", you can instantly access it from both of the URLs above. I checked it many times. The only thing that has a delay on it sometimes is v6. Discord can't show the image because it can't get the id of the asset key because it can't find it in the array. So it can't create the png URL. I have a few guesses but I'm not sure why it delays.

msciotti commented 5 years ago

Hey @DeepDoge - would you mind opening a separate issue for this? Just so we aren't spamming OP with GitHub notifications.

brr53 commented 3 years ago

I am still having this issue.