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

Handle avatar when it is passed as an argument in cli/config #17

Open
Kronopt opened this issue May 9, 2020 · 2 comments
Open

Handle avatar when it is passed as an argument in cli/config #17

Kronopt opened this issue May 9, 2020 · 2 comments
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@Kronopt
Copy link
Member

Kronopt commented May 9, 2020

As of right now, if the avatar path is passed as argument, the bot tries to edit its avatar every time it logins.
This can incur in too many avatar edits if the bot is restarted many times in a short period of time.

To fix, bot should check if the avatar in the path given as argument is the same as the current bot avatar.
Must download current avatar, hash it and compare hashes with the local avatar image

@Kronopt Kronopt added bug Something isn't working enhancement New feature or request labels May 9, 2020
@Kronopt Kronopt added this to the v1.0 milestone May 9, 2020
@Kronopt
Copy link
Member Author

Kronopt commented Jun 25, 2020

get bot avatar.
discord api image data.

  • Extensions should be limited to those allowed by the discord api. Try to convert image extension to one of those allowed by discord (using Pillow) and throw error if that's not possible.
  • Convert image size to the closest power of 2 between 16 and 4096
  • Download existing bot avatar (with the same size as the converted one) and check to see if the images are equal. Only upload a new avatar if they are different.

@Kronopt
Copy link
Member Author

Kronopt commented Jul 6, 2020

Maybe it would be better to catch the error related to too many avatar changes and then just schedule the avatar change for sometime later.
Maybe the error message has some sort of time until avatar can be changed again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant