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

Add extension getter for cdn assets #37

Merged
merged 9 commits into from
Aug 5, 2024
Merged

Conversation

Lexedia
Copy link
Member

@Lexedia Lexedia commented Apr 25, 2024

Description

Add a way to get the url of the asset without fetching it.

Test are failing because the CI bot doesnt have an avatar, and CdnRequest from nyxx doesn't forward qzery paramters .

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • Ran dart analyze or make analyze and fixed all issues
  • Ran dart format --set-exit-if-changed -l 160 ./lib or make format and fixed all issues
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

l7ssha
l7ssha previously approved these changes Apr 25, 2024
@l7ssha l7ssha added the enhancement New feature or request label Apr 25, 2024
@l7ssha l7ssha added this to the 4.2.0 milestone Apr 25, 2024
@Lexedia Lexedia self-assigned this Apr 25, 2024
@abitofevrything
Copy link
Member

The test could be changed to update the user's avatar to a sample file (there are already test image files in the nyxx repository), and then remove it later/restore it to what it was before.

In fact, what we can do is simply download the current avatar and then re-upload it from bytes. Something like this:

final currentAvatar = (await client.user.get()).avatar;

await client.users.updateCurrentUser(UserUpdateBuilder(
  avatar: ImageBuilder(data: await avatar.fetch(), format: currentAvatar.defaultFormat.extension),
));

This also indirectly serves as a test for updateCurrentUser, though we should probably also add tests for that to the nyxx repository...

@abitofevrything
Copy link
Member

Wow, why did GitHub close this? Reopening it...

@Lexedia
Copy link
Member Author

Lexedia commented Apr 25, 2024

Gotta love gh stopwords

@Lexedia Lexedia removed the blocked label Apr 25, 2024
@abitofevrything
Copy link
Member

FWIW this is still blocked until the next version of nyxx releases

@abitofevrything abitofevrything merged commit f88e0f7 into dev Aug 5, 2024
3 checks passed
@abitofevrything abitofevrything deleted the feat/static-assets branch August 5, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Ready for deploy
Development

Successfully merging this pull request may close these issues.

3 participants