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

feat: add animated banner guild feature #6812

Closed
wants to merge 2 commits into from

Conversation

iShibi
Copy link
Contributor

@iShibi iShibi commented Oct 11, 2021

Please describe the changes this PR makes and why it should be merged:

Status and versioning classification:

Comment on lines +516 to +524
/**
* The URL to this guild's banner.
* @param {ImageURLOptions} [options={}] Options for the Image URL
* @returns {?string}
*/
bannerURL({ format, size, dynamic } = {}) {
return this.banner && this.client.rest.cdn.Banner(this.id, this.banner, format, size, dynamic);
}

Copy link
Member

@Jiralite Jiralite Jan 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should instead be modified in the AnonymousGuild class:

/**
* The URL to this guild's banner.
* @param {StaticImageURLOptions} [options={}] Options for the Image URL
* @returns {?string}
*/
bannerURL({ format, size } = {}) {
return this.banner && this.client.rest.cdn.Banner(this.id, this.banner, format, size);
}

Both an InviteGuild and a Guild can receive the animated hash.

@Jiralite
Copy link
Member

Jiralite commented Apr 5, 2022

Upstream got merged. Are you able to continue, @iShibi?

@iShibi
Copy link
Contributor Author

iShibi commented Apr 6, 2022

Upstream got merged. Are you able to continue, @iShibi?

it's been a long gap, you can takeover if it's fine with you

@Jiralite
Copy link
Member

Jiralite commented Apr 6, 2022

I've looked over what needs to be done to support animated guild banners in discord.js.

For some reason, the AnonymousGuild's bannerURL() method already supports dynamic hashes:

/**
* The URL to this guild's banner.
* @param {ImageURLOptions} [options={}] Options for the image URL
* @returns {?string}
*/
bannerURL(options = {}) {
return this.banner && this.client.rest.cdn.banner(this.id, this.banner, options);
}

public bannerURL(options?: ImageURLOptions): string | null;

All that's left is to bump discord-api-types to 0.31.0 so the typings are updated for the new guild feature. However, this is already being done in #7634, so it looks like no pull request is needed for this and support will naturally come!

@SpaceEEC SpaceEEC closed this Apr 9, 2022
@SpaceEEC
Copy link
Member

SpaceEEC commented Apr 9, 2022

See comment above ^

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

Successfully merging this pull request may close these issues.

5 participants