discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
6k stars 1.26k forks source link

Bot Profile Picture becomes out of sync if you upload from the API #613

Closed andre-paulo98 closed 6 years ago

andre-paulo98 commented 6 years ago

If you upload a picture for the bot using a command, it won't update the picture on the developers website and stop you from updating the picture from the developers website.

Steps to reproduce:

  1. Make a new bot
  2. Have a command that changes the profile picture of the bot to some image
  3. Update the profile picture from the developers website (it will update automatically)
  4. Update the profile picture from the bot directly (it will update automatically)
  5. Go back to developers website (the image is still the one you uploaded on step 3)
  6. Try to upload a new picture from the website (it wont update unless you clear the cache)
  7. Upload a new picture using the bot (it will update automatically)
MinnDevelopment commented 6 years ago

The picture on the developers dashboard is for the application while the picture you upload using the bot is for the bot account. These are 2 different contexts. I believe this is intended behavior.

andre-paulo98 commented 6 years ago

But there is only one place to upload the picture on the developers dashboard.

ghost commented 6 years ago

@andre-paulo98 To update the bot account avatar, you have to use the API. This behaviour is intended.

andre-paulo98 commented 6 years ago

If the bot is online, you never updated the avatar directly with the API, and you update the avatar from the dashboard, the avatar of the bot (in the application) will update automatically. So you have 2 places to update the avatar, but you must pick one specifically, because if you try use one and then the other one things might break, doesn't sound intended behavior.

MoordMachineYT commented 6 years ago

Can’t say I haven’t had such problem, I was on holidays making me unable to access my account with my bot. So I went on an alternate account and created a new béta bot to work with, and set the image to the image my other bot has. On the website it showed the image. The bot, however, still had the default image. At that moment I was on my iPad. This happened like 3 months ago.

eritbh commented 6 years ago

A bit confused about what the issue here is, but I've messed around a bit and didn't see anything unusual. Dunno if this will be helpful or not but I've included my full repro attempt below.

Attempted repro steps 1. Create a blank new OAuth application from the dev apps page. No app icon is specified at creation. 2. Create a bot account under the new application. 3. Use the OAuth link generator to add the bot account to the server. The bot's avatar is the default Discord avatar as expected. No customizations were done on the generator page - the default, "bot" scope with no permissions, was used. 4. Change the app icon on the Discord dev apps page and click "save changes" at the bottom. Upon saving and refreshing the page, the new app icon is present. In Discord, the bot's avatar hasn't changed. 5. Use the API to load an avatar to the bot from a terminal via a script (shown below). Paste the bot token into the script immediately before running it. The bot's avatar was successfully changed in the client. This should be functionally the same as the OP's method of changing the avatar via a command. 6. Without reloading the page after uploading the new Discord avatar, upload a new app icon via the dev apps page and click "save changes" again. The new icon loads and refreshing the page confirms that it is saved. The bot's avatar in Discord has not changed. No inconsistencies here. 7. As one last attempt to break something, swap the image referenced in the aforementioned script to something else and re-run it. Once again, the bot's avatar on Discord updates normally, and reloading the apps page confirms that the app icon has not changed. Script used (JS, using Eris): https://gist.github.com/Geo1088/491d79261eab512edf121c08731f9f54
night commented 6 years ago

The bot avatar and application icon only stay in sync so long as the image hashes are equal. If the hashes differ then a change to an OAuth2 application icon will not update the bot's avatar. Since the avatar for the bot was updated outside of the OAuth2 application page, they no longer sync.