[Feature] add missing invite guild properties & welcome screen support (#2510)
* added models * working getter for welcome screen * <see langword="null"/> * more changes * modify welcome screen support * fix some typos & remove `using` added by VS * Working-ish state * Resolve some reviews * change access modifier * forgot to add docs * revert to InviteGuild & extend it * resolve some reviews * Apply suggestions from code review Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com> Co-authored-by: Cenk Ergen <57065323+Cenngo@users.noreply.github.com> Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
This commit is contained in:
@@ -83,5 +83,8 @@ namespace Discord.API
|
||||
public Sticker[] Stickers { get; set; }
|
||||
[JsonProperty("premium_progress_bar_enabled")]
|
||||
public Optional<bool> IsBoostProgressBarEnabled { get; set; }
|
||||
|
||||
[JsonProperty("welcome_screen")]
|
||||
public Optional<WelcomeScreen> WelcomeScreen { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,41 @@ namespace Discord.API
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public ulong Id { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("splash_hash")]
|
||||
public string SplashHash { get; set; }
|
||||
|
||||
[JsonProperty("splash")]
|
||||
public Optional<string> Splash { get; set; }
|
||||
|
||||
[JsonProperty("banner")]
|
||||
public Optional<string> BannerHash { get; set; }
|
||||
|
||||
[JsonProperty("description")]
|
||||
public Optional<string> Description { get; set; }
|
||||
|
||||
[JsonProperty("icon")]
|
||||
public Optional<string> IconHash { get; set; }
|
||||
|
||||
[JsonProperty("features")]
|
||||
public GuildFeatures Features { get; set; }
|
||||
|
||||
[JsonProperty("verification_level")]
|
||||
public VerificationLevel VerificationLevel { get; set; }
|
||||
|
||||
[JsonProperty("vanity_url_code")]
|
||||
public Optional<string> VanityUrlCode { get; set; }
|
||||
|
||||
[JsonProperty("premium_subscription_count")]
|
||||
public Optional<int> PremiumSubscriptionCount { get; set; }
|
||||
|
||||
[JsonProperty("nsfw")]
|
||||
public Optional<bool?> Nsfw { get; set; }
|
||||
|
||||
[JsonProperty("nsfw_level")]
|
||||
public NsfwLevel NsfwLevel { get; set; }
|
||||
|
||||
[JsonProperty("welcome_screen")]
|
||||
public Optional<WelcomeScreen> WelcomeScreen { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
12
src/Discord.Net.Rest/API/Common/WelcomeScreen.cs
Normal file
12
src/Discord.Net.Rest/API/Common/WelcomeScreen.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API;
|
||||
|
||||
internal class WelcomeScreen
|
||||
{
|
||||
[JsonProperty("description")]
|
||||
public Optional<string> Description { get; set; }
|
||||
|
||||
[JsonProperty("welcome_channels")]
|
||||
public WelcomeScreenChannel[] WelcomeChannels { get; set; }
|
||||
}
|
||||
18
src/Discord.Net.Rest/API/Common/WelcomeScreenChannel.cs
Normal file
18
src/Discord.Net.Rest/API/Common/WelcomeScreenChannel.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API;
|
||||
|
||||
internal class WelcomeScreenChannel
|
||||
{
|
||||
[JsonProperty("channel_id")]
|
||||
public ulong ChannelId { get; set; }
|
||||
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[JsonProperty("emoji_id")]
|
||||
public Optional<ulong?> EmojiId { get; set; }
|
||||
|
||||
[JsonProperty("emoji_name")]
|
||||
public Optional<string> EmojiName{ get; set; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Discord.API.Rest;
|
||||
|
||||
internal class ModifyGuildWelcomeScreenParams
|
||||
{
|
||||
[JsonProperty("enabled")]
|
||||
public Optional<bool> Enabled { get; set; }
|
||||
|
||||
[JsonProperty("welcome_channels")]
|
||||
public Optional<WelcomeScreenChannel[]> WelcomeChannels { get; set; }
|
||||
|
||||
[JsonProperty("description")]
|
||||
public Optional<string> Description { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user