* add active developer badge support * add `OwnerId` to threads * add default forum layout support * oops, forgot to update modifyasync * add missing application flags * Add `50155` error codepull/2534/head
@@ -177,6 +177,7 @@ namespace Discord | |||||
OwnershipCannotBeTransferredToABotUser = 50132, | OwnershipCannotBeTransferredToABotUser = 50132, | ||||
FailedToResizeAssetBelowTheMaximumSize = 50138, | FailedToResizeAssetBelowTheMaximumSize = 50138, | ||||
UploadedFileNotFound = 50146, | UploadedFileNotFound = 50146, | ||||
FeatureInProcessOfRollingOut = 50155, | |||||
MissingPermissionToSendThisSticker = 50600, | MissingPermissionToSendThisSticker = 50600, | ||||
#endregion | #endregion | ||||
@@ -4,20 +4,31 @@ using System.Linq; | |||||
using System.Text; | using System.Text; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
namespace Discord | |||||
namespace Discord; | |||||
/// <summary> | |||||
/// Represents public flags for an application. | |||||
/// </summary> | |||||
public enum ApplicationFlags | |||||
{ | { | ||||
/// <summary> | |||||
/// Represents public flags for an application. | |||||
/// </summary> | |||||
public enum ApplicationFlags | |||||
{ | |||||
GatewayPresence = 1 << 12, | |||||
GatewayPresenceLimited = 1 << 13, | |||||
GatewayGuildMembers = 1 << 14, | |||||
GatewayGuildMembersLimited = 1 << 15, | |||||
VerificationPendingGuildLimit = 1 << 16, | |||||
Embedded = 1 << 17, | |||||
GatewayMessageContent = 1 << 18, | |||||
GatewayMessageContentLimited = 1 << 19 | |||||
} | |||||
GatewayPresence = 1 << 12, | |||||
GatewayPresenceLimited = 1 << 13, | |||||
GatewayGuildMembers = 1 << 14, | |||||
GatewayGuildMembersLimited = 1 << 15, | |||||
VerificationPendingGuildLimit = 1 << 16, | |||||
Embedded = 1 << 17, | |||||
GatewayMessageContent = 1 << 18, | |||||
GatewayMessageContentLimited = 1 << 19, | |||||
ApplicationCommandBadge = 1 << 23, | |||||
ActiveApplication = 1 << 24 | |||||
} | } | ||||
@@ -57,4 +57,9 @@ public class ForumChannelProperties : TextChannelProperties | |||||
/// Gets or sets the rule used to order posts in forum channels. | /// Gets or sets the rule used to order posts in forum channels. | ||||
/// </summary> | /// </summary> | ||||
public Optional<ForumSortOrder> DefaultSortOrder { get; set; } | public Optional<ForumSortOrder> DefaultSortOrder { get; set; } | ||||
/// <summary> | |||||
/// Gets or sets the rule used to display posts in a forum channel. | |||||
/// </summary> | |||||
public Optional<ForumLayout> DefaultLayout { get; set; } | |||||
} | } |
@@ -0,0 +1,22 @@ | |||||
namespace Discord; | |||||
/// <summary> | |||||
/// Represents the layout type used to display posts in a forum channel. | |||||
/// </summary> | |||||
public enum ForumLayout | |||||
{ | |||||
/// <summary> | |||||
/// A preferred forum layout hasn't been set by a server admin | |||||
/// </summary> | |||||
Default = 0, | |||||
/// <summary> | |||||
/// List View: display forum posts in a text-focused list | |||||
/// </summary> | |||||
List = 1, | |||||
/// <summary> | |||||
/// Gallery View: display forum posts in a media-focused gallery | |||||
/// </summary> | |||||
Grid = 2 | |||||
} |
@@ -63,7 +63,7 @@ namespace Discord | |||||
IEmote DefaultReactionEmoji { get; } | IEmote DefaultReactionEmoji { get; } | ||||
/// <summary> | /// <summary> | ||||
/// Gets or sets the rule used to order posts in forum channels. | |||||
/// Gets the rule used to order posts in forum channels. | |||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Defaults to null, which indicates a preferred sort order hasn't been set | /// Defaults to null, which indicates a preferred sort order hasn't been set | ||||
@@ -71,6 +71,11 @@ namespace Discord | |||||
ForumSortOrder? DefaultSortOrder { get; } | ForumSortOrder? DefaultSortOrder { get; } | ||||
/// <summary> | /// <summary> | ||||
/// Gets the rule used to display posts in a forum channel. | |||||
/// </summary> | |||||
ForumLayout DefaultLayout { get; } | |||||
/// <summary> | |||||
/// Modifies this forum channel. | /// Modifies this forum channel. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
@@ -75,6 +75,11 @@ namespace Discord | |||||
new DateTimeOffset CreatedAt { get; } | new DateTimeOffset CreatedAt { get; } | ||||
/// <summary> | /// <summary> | ||||
/// Gets the id of the creator of the thread. | |||||
/// </summary> | |||||
ulong OwnerId { get; } | |||||
/// <summary> | |||||
/// Joins the current thread. | /// Joins the current thread. | ||||
/// </summary> | /// </summary> | ||||
/// <param name="options">The options to be used when sending the request.</param> | /// <param name="options">The options to be used when sending the request.</param> | ||||
@@ -69,5 +69,10 @@ namespace Discord | |||||
/// Flag given to bots that use only outgoing webhooks, exclusively. | /// Flag given to bots that use only outgoing webhooks, exclusively. | ||||
/// </summary> | /// </summary> | ||||
BotHTTPInteractions = 1 << 19, | BotHTTPInteractions = 1 << 19, | ||||
/// <summary> | |||||
/// Flag given to users that are active developers. | |||||
/// </summary> | |||||
ActiveDeveloper = 1 << 22 | |||||
} | } | ||||
} | } |
@@ -89,5 +89,8 @@ namespace Discord.API | |||||
[JsonProperty("default_reaction_emoji")] | [JsonProperty("default_reaction_emoji")] | ||||
public Optional<ForumReactionEmoji> DefaultReactionEmoji { get; set; } | public Optional<ForumReactionEmoji> DefaultReactionEmoji { get; set; } | ||||
[JsonProperty("default_forum_layout")] | |||||
public Optional<ForumLayout> DefaultForumLayout { get; set; } | |||||
} | } | ||||
} | } |
@@ -20,4 +20,7 @@ internal class ModifyForumChannelParams : ModifyTextChannelParams | |||||
[JsonProperty("default_sort_order")] | [JsonProperty("default_sort_order")] | ||||
public Optional<ForumSortOrder> DefaultSortOrder { get; set; } | public Optional<ForumSortOrder> DefaultSortOrder { get; set; } | ||||
[JsonProperty("default_forum_layout")] | |||||
public Optional<ForumLayout> DefaultLayout { get; set; } | |||||
} | } |
@@ -56,7 +56,8 @@ internal static class ForumHelper | |||||
emoji.Name : Optional<string>.Unspecified | emoji.Name : Optional<string>.Unspecified | ||||
} | } | ||||
: Optional<ModifyForumReactionEmojiParams>.Unspecified, | : Optional<ModifyForumReactionEmojiParams>.Unspecified, | ||||
DefaultSortOrder = args.DefaultSortOrder | |||||
DefaultSortOrder = args.DefaultSortOrder, | |||||
DefaultLayout = args.DefaultLayout, | |||||
}; | }; | ||||
return await client.ApiClient.ModifyGuildChannelAsync(channel.Id, apiArgs, options).ConfigureAwait(false); | return await client.ApiClient.ModifyGuildChannelAsync(channel.Id, apiArgs, options).ConfigureAwait(false); | ||||
} | } | ||||
@@ -41,6 +41,9 @@ namespace Discord.Rest | |||||
/// <inheritdoc/> | /// <inheritdoc/> | ||||
public ForumSortOrder? DefaultSortOrder { get; private set; } | public ForumSortOrder? DefaultSortOrder { get; private set; } | ||||
/// <inheritdoc /> | |||||
public ForumLayout DefaultLayout { get; private set; } | |||||
/// <inheritdoc/> | /// <inheritdoc/> | ||||
public string Mention => MentionUtils.MentionChannel(Id); | public string Mention => MentionUtils.MentionChannel(Id); | ||||
@@ -87,6 +90,7 @@ namespace Discord.Rest | |||||
} | } | ||||
CategoryId = model.CategoryId.GetValueOrDefault(); | CategoryId = model.CategoryId.GetValueOrDefault(); | ||||
DefaultLayout= model.DefaultForumLayout.GetValueOrDefault(); | |||||
} | } | ||||
/// <inheritdoc/> | /// <inheritdoc/> | ||||
@@ -40,6 +40,9 @@ namespace Discord.Rest | |||||
/// <inheritdoc/> | /// <inheritdoc/> | ||||
public IReadOnlyCollection<ulong> AppliedTags { get; private set; } | public IReadOnlyCollection<ulong> AppliedTags { get; private set; } | ||||
/// <inheritdoc/> | |||||
public ulong OwnerId { get; private set; } | |||||
/// <inheritdoc cref="IThreadChannel.CreatedAt"/> | /// <inheritdoc cref="IThreadChannel.CreatedAt"/> | ||||
public override DateTimeOffset CreatedAt { get; } | public override DateTimeOffset CreatedAt { get; } | ||||
@@ -76,6 +79,8 @@ namespace Discord.Rest | |||||
IsLocked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false); | IsLocked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false); | ||||
} | } | ||||
OwnerId = model.OwnerId.GetValueOrDefault(0); | |||||
MemberCount = model.MemberCount.GetValueOrDefault(0); | MemberCount = model.MemberCount.GetValueOrDefault(0); | ||||
MessageCount = model.MessageCount.GetValueOrDefault(0); | MessageCount = model.MessageCount.GetValueOrDefault(0); | ||||
Type = (ThreadType)model.Type; | Type = (ThreadType)model.Type; | ||||
@@ -45,6 +45,9 @@ namespace Discord.WebSocket | |||||
/// <inheritdoc/> | /// <inheritdoc/> | ||||
public ForumSortOrder? DefaultSortOrder { get; private set; } | public ForumSortOrder? DefaultSortOrder { get; private set; } | ||||
/// <inheritdoc /> | |||||
public ForumLayout DefaultLayout { get; private set; } | |||||
/// <summary> | /// <summary> | ||||
/// Gets the parent (category) of this channel in the guild's channel list. | /// Gets the parent (category) of this channel in the guild's channel list. | ||||
/// </summary> | /// </summary> | ||||
@@ -93,6 +96,8 @@ namespace Discord.WebSocket | |||||
} | } | ||||
CategoryId = model.CategoryId.GetValueOrDefault(); | CategoryId = model.CategoryId.GetValueOrDefault(); | ||||
DefaultLayout = model.DefaultForumLayout.GetValueOrDefault(); | |||||
} | } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
@@ -95,6 +95,9 @@ namespace Discord.WebSocket | |||||
/// <inheritdoc cref="IThreadChannel.CreatedAt"/> | /// <inheritdoc cref="IThreadChannel.CreatedAt"/> | ||||
public override DateTimeOffset CreatedAt { get; } | public override DateTimeOffset CreatedAt { get; } | ||||
/// <inheritdoc cref="IThreadChannel.OwnerId"/> | |||||
ulong IThreadChannel.OwnerId => _ownerId; | |||||
/// <summary> | /// <summary> | ||||
/// Gets a collection of cached users within this thread. | /// Gets a collection of cached users within this thread. | ||||
/// </summary> | /// </summary> | ||||