-
-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Add missing properties to Guild and deprecate GuildEmbed (#1573
) * Add missing properties to Guild, related methods, and deprecate GuildEmbed endpoints - Add missing guild properties: `discovery_splash`, `widget_enabled`, `widget_channel_id`, `rules_channel_id`, `max_presences`, `max_presences`, `max_members`, `public_updates_channel_id`, `max_video_channel_users`, `approximate_member_count`, `approximate_presence_count` - Update guild properties: `embed_enabled`, `embed_channel_id` - Add `GetGuildDiscoverySplashUrl` to `CDN` - Add classes related to the guild widget - Add `withCounts` parameter to `GetGuild(s)Async` - Make GuildEmbed related methods obsolete with a message redirecting to widget ones * Change xml docs and PremiumSubscriptionCount type * Changed some xml docs
- Loading branch information
Showing
14 changed files
with
644 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/Discord.Net.Core/Entities/Guilds/GuildWidgetProperties.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace Discord | ||
{ | ||
/// <summary> | ||
/// Provides properties that are used to modify the widget of an <see cref="IGuild" /> with the specified changes. | ||
/// </summary> | ||
public class GuildWidgetProperties | ||
{ | ||
/// <summary> | ||
/// Sets whether the widget should be enabled. | ||
/// </summary> | ||
public Optional<bool> Enabled { get; set; } | ||
/// <summary> | ||
/// Sets the channel that the invite should place its users in, if not <see langword="null" />. | ||
/// </summary> | ||
public Optional<IChannel> Channel { get; set; } | ||
/// <summary> | ||
/// Sets the channel that the invite should place its users in, if not <see langword="null" />. | ||
/// </summary> | ||
public Optional<ulong?> ChannelId { get; set; } | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma warning disable CS1591 | ||
using Newtonsoft.Json; | ||
|
||
namespace Discord.API | ||
{ | ||
internal class GuildWidget | ||
{ | ||
[JsonProperty("enabled")] | ||
public bool Enabled { get; set; } | ||
[JsonProperty("channel_id")] | ||
public ulong? ChannelId { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma warning disable CS1591 | ||
using Newtonsoft.Json; | ||
|
||
namespace Discord.API.Rest | ||
{ | ||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] | ||
internal class ModifyGuildWidgetParams | ||
{ | ||
[JsonProperty("enabled")] | ||
public Optional<bool> Enabled { get; set; } | ||
[JsonProperty("channel")] | ||
public Optional<ulong?> ChannelId { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.