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(cdn): add support for scheduled event image covers #7335

Merged
merged 1 commit into from
Jan 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/rest/src/lib/CDN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,20 @@ export class CDN {
return this.makeURL(`/team-icons/${teamId}/${iconHash}`, options);
}

/**
* Generates a cover image for a guild scheduled event.
* @param scheduledEventId The scheduled event id
* @param coverHash The hash provided by discord for this cover image
* @param options Optional options for the cover image
*/
public guildScheduledEventCover(
scheduledEventId: string,
coverHash: string,
options?: Readonly<BaseImageURLOptions>,
): string {
return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options);
}

/**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
* @param route The base cdn route
Expand Down