Add Image property to Guild Scheduled Events (#2151)

* Add Image property to create and modify events

* Add CDN routes to get cover image

* Update banner names

* Update CDN.cs

* Update IGuildScheduledEvent.cs
This commit is contained in:
Quin Lynch
2022-03-02 19:22:08 -04:00
committed by GitHub
parent 202554fdde
commit 1dc473c7e4
12 changed files with 74 additions and 8 deletions

View File

@@ -208,6 +208,18 @@ namespace Discord
public static string GetStickerUrl(ulong stickerId, StickerFormatType format = StickerFormatType.Png)
=> $"{DiscordConfig.CDNUrl}stickers/{stickerId}.{FormatToExtension(format)}";
/// <summary>
/// Returns an events cover image url.
/// </summary>
/// <param name="guildId">The guild id that the event is in.</param>
/// <param name="eventId">The id of the event.</param>
/// <param name="assetId">The id of the cover image asset.</param>
/// <param name="format">The format of the image.</param>
/// <param name="size">The size of the image.</param>
/// <returns></returns>
public static string GetEventCoverImageUrl(ulong guildId, ulong eventId, string assetId, ImageFormat format = ImageFormat.Auto, ushort size = 1024)
=> $"{DiscordConfig.CDNUrl}guild-events/{guildId}/{eventId}/{assetId}.{FormatToExtension(format, assetId)}?size={size}";
private static string FormatToExtension(StickerFormatType format)
{
return format switch