feature: Add ability to modify the banner for guilds (#1432)
This commit is contained in:
committed by
Christopher F
parent
a4846516fb
commit
d734ce0a11
@@ -38,6 +38,10 @@ namespace Discord
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Optional<Image?> Icon { get; set; }
|
public Optional<Image?> Icon { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Gets or sets the banner of the guild.
|
||||||
|
/// </summary>
|
||||||
|
public Optional<Image?> Banner { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// Gets or sets the guild's splash image.
|
/// Gets or sets the guild's splash image.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ namespace Discord.API.Rest
|
|||||||
public Optional<ulong?> SystemChannelId { get; set; }
|
public Optional<ulong?> SystemChannelId { get; set; }
|
||||||
[JsonProperty("icon")]
|
[JsonProperty("icon")]
|
||||||
public Optional<Image?> Icon { get; set; }
|
public Optional<Image?> Icon { get; set; }
|
||||||
|
[JsonProperty("banner")]
|
||||||
|
public Optional<Image?> Banner { get; set; }
|
||||||
[JsonProperty("splash")]
|
[JsonProperty("splash")]
|
||||||
public Optional<Image?> Splash { get; set; }
|
public Optional<Image?> Splash { get; set; }
|
||||||
[JsonProperty("afk_channel_id")]
|
[JsonProperty("afk_channel_id")]
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ namespace Discord.Rest
|
|||||||
Icon = args.Icon.IsSpecified ? args.Icon.Value?.ToModel() : Optional.Create<ImageModel?>(),
|
Icon = args.Icon.IsSpecified ? args.Icon.Value?.ToModel() : Optional.Create<ImageModel?>(),
|
||||||
Name = args.Name,
|
Name = args.Name,
|
||||||
Splash = args.Splash.IsSpecified ? args.Splash.Value?.ToModel() : Optional.Create<ImageModel?>(),
|
Splash = args.Splash.IsSpecified ? args.Splash.Value?.ToModel() : Optional.Create<ImageModel?>(),
|
||||||
|
Banner = args.Banner.IsSpecified ? args.Banner.Value?.ToModel() : Optional.Create<ImageModel?>(),
|
||||||
VerificationLevel = args.VerificationLevel,
|
VerificationLevel = args.VerificationLevel,
|
||||||
ExplicitContentFilter = args.ExplicitContentFilter,
|
ExplicitContentFilter = args.ExplicitContentFilter,
|
||||||
SystemChannelFlags = args.SystemChannelFlags
|
SystemChannelFlags = args.SystemChannelFlags
|
||||||
@@ -57,6 +58,8 @@ namespace Discord.Rest
|
|||||||
else if (args.RegionId.IsSpecified)
|
else if (args.RegionId.IsSpecified)
|
||||||
apiArgs.RegionId = args.RegionId.Value;
|
apiArgs.RegionId = args.RegionId.Value;
|
||||||
|
|
||||||
|
if (!apiArgs.Banner.IsSpecified && guild.BannerId != null)
|
||||||
|
apiArgs.Banner = new ImageModel(guild.BannerId);
|
||||||
if (!apiArgs.Splash.IsSpecified && guild.SplashId != null)
|
if (!apiArgs.Splash.IsSpecified && guild.SplashId != null)
|
||||||
apiArgs.Splash = new ImageModel(guild.SplashId);
|
apiArgs.Splash = new ImageModel(guild.SplashId);
|
||||||
if (!apiArgs.Icon.IsSpecified && guild.IconId != null)
|
if (!apiArgs.Icon.IsSpecified && guild.IconId != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user