diff --git a/src/structures/GuildScheduledEvent.js b/src/structures/GuildScheduledEvent.js index ff862b87cf44..263a7de58a0a 100644 --- a/src/structures/GuildScheduledEvent.js +++ b/src/structures/GuildScheduledEvent.js @@ -156,6 +156,21 @@ class GuildScheduledEvent extends Base { } else { this.entityMetadata ??= null; } + + /** + * The cover image hash for this scheduled event + * @type {?string} + */ + this.image = data.image ?? null; + } + + /** + * The URL of this scheduled event's cover image + * @param {StaticImageURLOptions} [options={}] Options for image URL + * @returns {?string} + */ + coverImageURL({ format, size } = {}) { + return this.image && this.client.rest.cdn.guildScheduledEventCover(this.id, this.image, format, size); } /** diff --git a/src/util/Constants.js b/src/util/Constants.js index 14b0e526c906..c09af5d23928 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -77,6 +77,8 @@ exports.Endpoints = { `${root}/stickers/${stickerId}.${stickerFormat === 'LOTTIE' ? 'json' : 'png'}`, RoleIcon: (roleId, hash, format = 'webp', size) => makeImageUrl(`${root}/role-icons/${roleId}/${hash}`, { size, format }), + guildScheduledEventCover: (scheduledEventId, coverHash, format, size) => + makeImageUrl(`${root}/guild-events/${scheduledEventId}/${coverHash}`, { size, format }), }; }, invite: (root, code, eventId) => (eventId ? `${root}/${code}?event=${eventId}` : `${root}/${code}`), diff --git a/typings/index.d.ts b/typings/index.d.ts index 9a8f4fa413e3..9ce2bb730a6f 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1187,6 +1187,8 @@ export class GuildScheduledEvent; public edit>( options: GuildScheduledEventEditOptions,