-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add image URL methods and recurrence rule support - Added methods to `Application`, `CustomEmoji`, `Role`, `Sticker`, and `Team` classes for retrieving image URLs. - Enhanced `GuildScheduledEvent` and `JsonGuildScheduledEvent` with cover image hashes and recurrence rules. - Modified `GuildUser` to use expression-bodied member for `GuildId`. - Updated `ImageFormat` enum to inherit from `byte`. - Improved `ImageUrl` class with new URL generation methods and optimized `IsSizeValid`. - Added `GuildBannerHash` property to `JsonGuildUser`. - Enhanced `PartialGuildUser` with properties for guild banners and avatar decorations. - Updated `RestGuild` with widget URL generation and modified `EveryoneRole` property. - Introduced new classes and enums for guild scheduled event recurrence rules. - Added JSON model classes for recurrence rule functionality. * Improve exception * Fix xml docs
- Loading branch information
Showing
21 changed files
with
205 additions
and
18 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
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,28 @@ | ||
using NetCord.JsonModels; | ||
|
||
namespace NetCord; | ||
|
||
public class GuildScheduledEventRecurrenceRule(JsonGuildScheduledEventRecurrenceRule jsonModel) : IJsonModel<JsonGuildScheduledEventRecurrenceRule> | ||
{ | ||
JsonGuildScheduledEventRecurrenceRule IJsonModel<JsonGuildScheduledEventRecurrenceRule>.JsonModel => jsonModel; | ||
|
||
public DateTimeOffset? StartAt => jsonModel.StartAt; | ||
|
||
public DateTimeOffset? EndAt => jsonModel.EndAt; | ||
|
||
public GuildScheduledEventRecurrenceRuleFrequency Frequency => jsonModel.Frequency; | ||
|
||
public int Interval => jsonModel.Interval; | ||
|
||
public GuildScheduledEventRecurrenceRuleWeekday? ByWeekday => jsonModel.ByWeekday; | ||
|
||
public GuildScheduledEventRecurrenceRuleNWeekday ByNWeekday { get; } = new(jsonModel.ByNWeekday); | ||
|
||
public GuildScheduledEventRecurrenceRuleMonth? ByMonth => jsonModel.ByMonth; | ||
|
||
public IReadOnlyList<int>? ByMonthDay => jsonModel.ByMonthDay; | ||
|
||
public IReadOnlyList<int>? ByYearDay => jsonModel.ByYearDay; | ||
|
||
public int? Count => jsonModel.Count; | ||
} |
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,9 @@ | ||
namespace NetCord; | ||
|
||
public enum GuildScheduledEventRecurrenceRuleFrequency : byte | ||
{ | ||
Yearly = 0, | ||
Monthly = 1, | ||
Weekly = 2, | ||
Daily = 3, | ||
} |
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,17 @@ | ||
namespace NetCord; | ||
|
||
public enum GuildScheduledEventRecurrenceRuleMonth | ||
{ | ||
January = 1, | ||
February = 2, | ||
March = 3, | ||
April = 4, | ||
May = 5, | ||
June = 6, | ||
July = 7, | ||
August = 8, | ||
September = 9, | ||
October = 10, | ||
November = 11, | ||
December = 12, | ||
} |
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,12 @@ | ||
using NetCord.JsonModels; | ||
|
||
namespace NetCord; | ||
|
||
public class GuildScheduledEventRecurrenceRuleNWeekday(JsonGuildScheduledEventRecurrenceRuleNWeekday jsonModel) : IJsonModel<JsonGuildScheduledEventRecurrenceRuleNWeekday> | ||
{ | ||
JsonGuildScheduledEventRecurrenceRuleNWeekday IJsonModel<JsonGuildScheduledEventRecurrenceRuleNWeekday>.JsonModel => jsonModel; | ||
|
||
public int N => jsonModel.N; | ||
|
||
public GuildScheduledEventRecurrenceRuleWeekday Day => jsonModel.Day; | ||
} |
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,12 @@ | ||
namespace NetCord; | ||
|
||
public enum GuildScheduledEventRecurrenceRuleWeekday : byte | ||
{ | ||
Monday = 0, | ||
Tuesday = 1, | ||
Wednesday = 2, | ||
Thursday = 3, | ||
Friday = 4, | ||
Saturday = 5, | ||
Sunday = 6, | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace NetCord; | ||
|
||
public enum ImageFormat | ||
public enum ImageFormat : byte | ||
{ | ||
Jpeg, | ||
Png, | ||
|
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
36 changes: 36 additions & 0 deletions
36
NetCord/JsonModels/JsonGuildScheduledEventRecurrenceRule.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,36 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace NetCord.JsonModels; | ||
|
||
public class JsonGuildScheduledEventRecurrenceRule | ||
{ | ||
[JsonPropertyName("start")] | ||
public DateTimeOffset? StartAt { get; set; } | ||
|
||
[JsonPropertyName("end")] | ||
public DateTimeOffset? EndAt { get; set; } | ||
|
||
[JsonPropertyName("frequency")] | ||
public GuildScheduledEventRecurrenceRuleFrequency Frequency { get; set; } | ||
|
||
[JsonPropertyName("interval")] | ||
public int Interval { get; set; } | ||
|
||
[JsonPropertyName("by_weekday")] | ||
public GuildScheduledEventRecurrenceRuleWeekday? ByWeekday { get; set; } | ||
|
||
[JsonPropertyName("by_n_weekday")] | ||
public JsonGuildScheduledEventRecurrenceRuleNWeekday ByNWeekday { get; set; } | ||
|
||
[JsonPropertyName("by_month")] | ||
public GuildScheduledEventRecurrenceRuleMonth? ByMonth { get; set; } | ||
|
||
[JsonPropertyName("by_month_day")] | ||
public int[]? ByMonthDay { get; set; } | ||
|
||
[JsonPropertyName("by_year_day")] | ||
public int[]? ByYearDay { get; set; } | ||
|
||
[JsonPropertyName("count")] | ||
public int? Count { get; } | ||
} |
12 changes: 12 additions & 0 deletions
12
NetCord/JsonModels/JsonGuildScheduledEventRecurrenceRuleNWeekday.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,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace NetCord.JsonModels; | ||
|
||
public class JsonGuildScheduledEventRecurrenceRuleNWeekday | ||
{ | ||
[JsonPropertyName("n")] | ||
public int N { get; set; } | ||
|
||
[JsonPropertyName("day")] | ||
public GuildScheduledEventRecurrenceRuleWeekday Day { 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
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