| @@ -27,7 +27,7 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Returns the maximum length of description allowed by Discord. | /// Returns the maximum length of description allowed by Discord. | ||||
| /// </summary> | /// </summary> | ||||
| public const int MaxDescriptionLength = 2048; | |||||
| public const int MaxDescriptionLength = 4096; | |||||
| /// <summary> | /// <summary> | ||||
| /// Returns the maximum length of total characters allowed by Discord. | /// Returns the maximum length of total characters allowed by Discord. | ||||
| /// </summary> | /// </summary> | ||||
| @@ -20,6 +20,10 @@ namespace Discord | |||||
| /// </summary> | /// </summary> | ||||
| IReadOnlyList<ITeamMember> TeamMembers { get; } | IReadOnlyList<ITeamMember> TeamMembers { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the name of this team. | |||||
| /// </summary> | |||||
| string Name { get; } | |||||
| /// <summary> | |||||
| /// Gets the user identifier that owns this team. | /// Gets the user identifier that owns this team. | ||||
| /// </summary> | /// </summary> | ||||
| ulong OwnerUserId { get; } | ulong OwnerUserId { get; } | ||||
| @@ -27,7 +27,7 @@ namespace Discord | |||||
| /// <summary> Fills the embed author field with the provided user's full username and avatar URL. </summary> | /// <summary> Fills the embed author field with the provided user's full username and avatar URL. </summary> | ||||
| public static EmbedBuilder WithAuthor(this EmbedBuilder builder, IUser user) => | public static EmbedBuilder WithAuthor(this EmbedBuilder builder, IUser user) => | ||||
| builder.WithAuthor($"{user.Username}#{user.Discriminator}", user.GetAvatarUrl()); | |||||
| builder.WithAuthor($"{user.Username}#{user.Discriminator}", user.GetAvatarUrl() ?? user.GetDefaultAvatarUrl()); | |||||
| /// <summary> Converts a <see cref="EmbedType.Rich"/> <see cref="IEmbed"/> object to a <see cref="EmbedBuilder"/>. </summary> | /// <summary> Converts a <see cref="EmbedType.Rich"/> <see cref="IEmbed"/> object to a <see cref="EmbedBuilder"/>. </summary> | ||||
| /// <exception cref="InvalidOperationException">The embed type is not <see cref="EmbedType.Rich"/>.</exception> | /// <exception cref="InvalidOperationException">The embed type is not <see cref="EmbedType.Rich"/>.</exception> | ||||
| @@ -11,6 +11,8 @@ namespace Discord.API | |||||
| public ulong Id { get; set; } | public ulong Id { get; set; } | ||||
| [JsonProperty("members")] | [JsonProperty("members")] | ||||
| public TeamMember[] TeamMembers { get; set; } | public TeamMember[] TeamMembers { get; set; } | ||||
| [JsonProperty("name")] | |||||
| public string Name { get; set; } | |||||
| [JsonProperty("owner_user_id")] | [JsonProperty("owner_user_id")] | ||||
| public ulong OwnerUserId { get; set; } | public ulong OwnerUserId { get; set; } | ||||
| } | } | ||||
| @@ -12,6 +12,8 @@ namespace Discord.Rest | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public IReadOnlyList<ITeamMember> TeamMembers { get; private set; } | public IReadOnlyList<ITeamMember> TeamMembers { get; private set; } | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public string Name { get; private set; } | |||||
| /// <inheritdoc /> | |||||
| public ulong OwnerUserId { get; private set; } | public ulong OwnerUserId { get; private set; } | ||||
| private string _iconId; | private string _iconId; | ||||
| @@ -30,6 +32,7 @@ namespace Discord.Rest | |||||
| { | { | ||||
| if (model.Icon.IsSpecified) | if (model.Icon.IsSpecified) | ||||
| _iconId = model.Icon.Value; | _iconId = model.Icon.Value; | ||||
| Name = model.Name; | |||||
| OwnerUserId = model.OwnerUserId; | OwnerUserId = model.OwnerUserId; | ||||
| TeamMembers = model.TeamMembers.Select(x => new RestTeamMember(Discord, x)).ToImmutableArray(); | TeamMembers = model.TeamMembers.Select(x => new RestTeamMember(Discord, x)).ToImmutableArray(); | ||||
| } | } | ||||
| @@ -126,7 +126,7 @@ namespace Discord | |||||
| { | { | ||||
| IEnumerable<string> GetInvalid() | IEnumerable<string> GetInvalid() | ||||
| { | { | ||||
| yield return new string('a', 2049); | |||||
| yield return new string('a', 4097); | |||||
| } | } | ||||
| foreach (var description in GetInvalid()) | foreach (var description in GetInvalid()) | ||||
| { | { | ||||
| @@ -149,7 +149,7 @@ namespace Discord | |||||
| { | { | ||||
| yield return string.Empty; | yield return string.Empty; | ||||
| yield return null; | yield return null; | ||||
| yield return new string('a', 2048); | |||||
| yield return new string('a', 4096); | |||||
| } | } | ||||
| foreach (var description in GetValid()) | foreach (var description in GetValid()) | ||||
| { | { | ||||