diff --git a/src/Models/AuditLog/AuditEntryInfo.cs b/src/Models/AuditLog/AuditEntryInfo.cs
index 605383268..c8a5f2c9a 100644
--- a/src/Models/AuditLog/AuditEntryInfo.cs
+++ b/src/Models/AuditLog/AuditEntryInfo.cs
@@ -16,10 +16,10 @@ namespace Discord.Net.Models
/// Id of the message that was targeted.
/// Number of entities that were targeted.
/// Id of the overwritten entity.
- /// Type of overwritten entity - "0" for "role" or "1" for "member".
- /// Name of the role if type is "0" (not present if type is "1").
+ /// Type of overwritten entity.
+ /// Name of the role if type is (not present if type is ).
[JsonConstructor]
- public AuditEntryInfo(int deleteMemberDays, int membersRemoved, Snowflake channelId, Snowflake messageId, int count, Snowflake id, AuditEntryInfoType type, string roleName)
+ public AuditEntryInfo(int? deleteMemberDays, int? membersRemoved, Snowflake? channelId, Snowflake? messageId, int? count, Snowflake? id, AuditEntryInfoType? type, string? roleName)
{
DeleteMemberDays = deleteMemberDays;
MembersRemoved = membersRemoved;
@@ -35,48 +35,48 @@ namespace Discord.Net.Models
/// Number of days after which inactive members were kicked.
///
[JsonPropertyName("delete_member_days")]
- public int DeleteMemberDays { get; }
+ public int? DeleteMemberDays { get; }
///
/// Number of members removed by the prune.
///
[JsonPropertyName("members_removed")]
- public int MembersRemoved { get; }
+ public int? MembersRemoved { get; }
///
/// Channel in which the entities were targeted.
///
[JsonPropertyName("channel_id")]
- public Snowflake ChannelId { get; }
+ public Snowflake? ChannelId { get; }
///
/// Id of the message that was targeted.
///
[JsonPropertyName("message_id")]
- public Snowflake MessageId { get; }
+ public Snowflake? MessageId { get; }
///
/// Number of entities that were targeted.
///
[JsonPropertyName("count")]
- public int Count { get; }
+ public int? Count { get; }
///
/// Id of the overwritten entity.
///
[JsonPropertyName("id")]
- public Snowflake Id { get; }
+ public Snowflake? Id { get; }
///
/// Type of overwritten entity.
///
[JsonPropertyName("type")]
- public AuditEntryInfoType Type { get; }
+ public AuditEntryInfoType? Type { get; }
///
/// Name of the role if type is (not present if type is ).
///
[JsonPropertyName("role_name")]
- public string RoleName { get; }
+ public string? RoleName { get; }
}
}
diff --git a/src/Models/Channel/Message/AllowedMentions.cs b/src/Models/Channel/Message/AllowedMentions.cs
index 5bccca8cd..a818053d0 100644
--- a/src/Models/Channel/Message/AllowedMentions.cs
+++ b/src/Models/Channel/Message/AllowedMentions.cs
@@ -15,7 +15,7 @@ namespace Discord.Net.Models
/// Array of user_ids to mention (Max size of 100).
/// For replies, whether to mention the author of the message being replied to (default false).
[JsonConstructor]
- public AllowedMentions(AllowedMentionType[] parse, ListOfSnowflakes roles, ListOfSnowflakes users, bool repliedUser)
+ public AllowedMentions(string[] parse, Snowflake[] roles, Snowflake[] users, bool repliedUser)
{
Parse = parse;
Roles = roles;
@@ -27,19 +27,19 @@ namespace Discord.Net.Models
/// An array of allowed mention types to parse from the content.
///
[JsonPropertyName("parse")]
- public AllowedMentionType[] Parse { get; }
+ public string[] Parse { get; }
///
/// Array of role_ids to mention (Max size of 100).
///
[JsonPropertyName("roles")]
- public ListOfSnowflakes Roles { get; }
+ public Snowflake[] Roles { get; }
///
/// Array of user_ids to mention (Max size of 100).
///
[JsonPropertyName("users")]
- public ListOfSnowflakes Users { get; }
+ public Snowflake[] Users { get; }
///
/// For replies, whether to mention the author of the message being replied to (default false).
diff --git a/src/Models/Channel/Message/Message.cs b/src/Models/Channel/Message/Message.cs
index 886f06545..073f01e2c 100644
--- a/src/Models/Channel/Message/Message.cs
+++ b/src/Models/Channel/Message/Message.cs
@@ -42,7 +42,7 @@ namespace Discord.Net.Models
/// The thread that was started from this message, includes thread member object.
/// Sent if the message contains components like buttons, action rows, or other interactive components.
[JsonConstructor]
- public Message(Snowflake id, Snowflake channelId, Optional guildId, User author, Optional member, string content, DateTimeOffset timestamp, DateTimeOffset? editedTimestamp, bool tts, bool mentionEveryone, UserWithMember[] mentions, Snowflake[] mentionRoles, Optional mentionChannels, Attachment[] attachments, Embed[] embeds, Optional reactions, Optional nonce, bool pinned, Optional webhookId, int type, Optional activity, Optional application, Optional applicationId, Optional messageReference, Optional flags, Optional stickers, Optional referencedMessage, Optional interaction, Optional thread, Optional components)
+ public Message(Snowflake id, Snowflake channelId, Optional guildId, User author, Optional member, string content, DateTimeOffset timestamp, DateTimeOffset? editedTimestamp, bool tts, bool mentionEveryone, UserMention[] mentions, Snowflake[] mentionRoles, Optional mentionChannels, Attachment[] attachments, Embed[] embeds, Optional reactions, Optional nonce, bool pinned, Optional webhookId, int type, Optional activity, Optional application, Optional applicationId, Optional messageReference, Optional flags, Optional stickers, Optional referencedMessage, Optional interaction, Optional thread, Optional components)
{
Id = id;
ChannelId = channelId;
diff --git a/src/Models/Gateway/Activity.cs b/src/Models/Gateway/Activity.cs
new file mode 100644
index 000000000..3ac1fb74e
--- /dev/null
+++ b/src/Models/Gateway/Activity.cs
@@ -0,0 +1,138 @@
+using System.Text.Json.Serialization;
+
+namespace Discord.Net.Models
+{
+ ///
+ /// Represents an activity object.
+ ///
+ public record Activity
+ {
+ ///
+ /// Creates a with the provided parameters.
+ ///
+ /// The activity's name.
+ /// Activity type.
+ /// Stream url, is validated when type is 1.
+ /// Unix timestamp of when the activity was added to the user's session.
+ /// Unix timestamps for start and/or end of the game.
+ /// Application id for the game.
+ /// What the player is currently doing.
+ /// The user's current party status.
+ /// The emoji used for a custom status.
+ /// Information for the current party of the player.
+ /// Images for the presence and their hover texts.
+ /// Secrets for Rich Presence joining and spectating.
+ /// Whether or not the activity is an instanced game session.
+ /// Activity flags ORd together, describes what the payload includes.
+ /// The custom buttons shown in the Rich Presence (max 2).
+ [JsonConstructor]
+ public Activity(string name, int type, Optional url, int createdAt, Optional timestamps, Optional applicationId, Optional details, Optional state, Optional emoji, Optional party, Optional assets, Optional secrets, Optional instance, Optional flags, Optional buttonLabels)
+ {
+ Name = name;
+ Type = type;
+ Url = url;
+ CreatedAt = createdAt;
+ Timestamps = timestamps;
+ ApplicationId = applicationId;
+ Details = details;
+ State = state;
+ Emoji = emoji;
+ Party = party;
+ Assets = assets;
+ Secrets = secrets;
+ Instance = instance;
+ Flags = flags;
+ ButtonLabels = buttonLabels;
+ }
+
+ ///
+ /// The activity's name.
+ ///
+ [JsonPropertyName("name")]
+ public string Name { get; }
+
+ ///
+ /// Activity type.
+ ///
+ [JsonPropertyName("type")]
+ public int Type { get; }
+
+ ///
+ /// Stream url, is validated when type is 1.
+ ///
+ [JsonPropertyName("url")]
+ public Optional Url { get; }
+
+ ///
+ /// Unix timestamp of when the activity was added to the user's session.
+ ///
+ [JsonPropertyName("created_at")]
+ public int CreatedAt { get; }
+
+ ///
+ /// Unix timestamps for start and/or end of the game.
+ ///
+ [JsonPropertyName("timestamps")]
+ public Optional Timestamps { get; }
+
+ ///
+ /// Application id for the game.
+ ///
+ [JsonPropertyName("application_id")]
+ public Optional ApplicationId { get; }
+
+ ///
+ /// What the player is currently doing.
+ ///
+ [JsonPropertyName("details")]
+ public Optional Details { get; }
+
+ ///
+ /// The user's current party status.
+ ///
+ [JsonPropertyName("state")]
+ public Optional State { get; }
+
+ ///
+ /// The emoji used for a custom status.
+ ///
+ [JsonPropertyName("emoji")]
+ public Optional Emoji { get; }
+
+ ///
+ /// Information for the current party of the player.
+ ///
+ [JsonPropertyName("party")]
+ public Optional Party { get; }
+
+ ///
+ /// Images for the presence and their hover texts.
+ ///
+ [JsonPropertyName("assets")]
+ public Optional Assets { get; }
+
+ ///
+ /// Secrets for Rich Presence joining and spectating.
+ ///
+ [JsonPropertyName("secrets")]
+ public Optional Secrets { get; }
+
+ ///
+ /// Whether or not the activity is an instanced game session.
+ ///
+ [JsonPropertyName("instance")]
+ public Optional Instance { get; }
+
+ ///
+ /// Activity flags ORd together, describes what the payload includes.
+ ///
+ [JsonPropertyName("flags")]
+ public Optional Flags { get; }
+
+ ///
+ /// The custom buttons shown in the Rich Presence (max 2).
+ ///
+ [JsonPropertyName("buttons")]
+ public Optional ButtonLabels { get; }
+ }
+}
diff --git a/src/Models/Gateway/ActivityAssets.cs b/src/Models/Gateway/ActivityAssets.cs
new file mode 100644
index 000000000..e80680280
--- /dev/null
+++ b/src/Models/Gateway/ActivityAssets.cs
@@ -0,0 +1,50 @@
+using System.Text.Json.Serialization;
+
+namespace Discord.Net.Models
+{
+ ///
+ /// Represents an activity assets object.
+ ///
+ public record ActivityAssets
+ {
+ ///
+ /// Creates a with the provided parameters.
+ ///
+ /// The id for a large asset of the activity, usually a snowflake.
+ /// Text displayed when hovering over the large image of the activity.
+ /// The id for a small asset of the activity, usually a snowflake.
+ /// Text displayed when hovering over the small image of the activity.
+ [JsonConstructor]
+ public ActivityAssets(Optional largeImage, Optional largeText, Optional smallImage, Optional smallText)
+ {
+ LargeImage = largeImage;
+ LargeText = largeText;
+ SmallImage = smallImage;
+ SmallText = smallText;
+ }
+
+ ///
+ /// The id for a large asset of the activity, usually a snowflake.
+ ///
+ [JsonPropertyName("large_image")]
+ public Optional LargeImage { get; }
+
+ ///
+ /// Text displayed when hovering over the large image of the activity.
+ ///
+ [JsonPropertyName("large_text")]
+ public Optional LargeText { get; }
+
+ ///
+ /// The id for a small asset of the activity, usually a snowflake.
+ ///
+ [JsonPropertyName("small_image")]
+ public Optional SmallImage { get; }
+
+ ///
+ /// Text displayed when hovering over the small image of the activity.
+ ///
+ [JsonPropertyName("small_text")]
+ public Optional SmallText { get; }
+ }
+}
diff --git a/src/Models/Gateway/ActivityEmoji.cs b/src/Models/Gateway/ActivityEmoji.cs
new file mode 100644
index 000000000..123318ff1
--- /dev/null
+++ b/src/Models/Gateway/ActivityEmoji.cs
@@ -0,0 +1,42 @@
+using System.Text.Json.Serialization;
+
+namespace Discord.Net.Models
+{
+ ///
+ /// Represents an activity emoji object.
+ ///
+ public record ActivityEmoji
+ {
+ ///
+ /// Creates a with the provided parameters.
+ ///
+ /// The name of the emoji.
+ /// The id of the emoji.
+ /// Whether this emoji is animated.
+ [JsonConstructor]
+ public ActivityEmoji(string name, Optional id, Optional animated)
+ {
+ Name = name;
+ Id = id;
+ Animated = animated;
+ }
+
+ ///
+ /// The name of the emoji.
+ ///
+ [JsonPropertyName("name")]
+ public string Name { get; }
+
+ ///
+ /// The id of the emoji.
+ ///
+ [JsonPropertyName("id")]
+ public Optional Id { get; }
+
+ ///
+ /// Whether this emoji is animated.
+ ///
+ [JsonPropertyName("animated")]
+ public Optional Animated { get; }
+ }
+}
diff --git a/src/Models/Gateway/ActivityFlags.cs b/src/Models/Gateway/ActivityFlags.cs
new file mode 100644
index 000000000..e5563c8db
--- /dev/null
+++ b/src/Models/Gateway/ActivityFlags.cs
@@ -0,0 +1,41 @@
+using System;
+
+namespace Discord.Net.Models
+{
+ ///
+ /// Represents the activity flags.
+ ///
+ [Flags]
+ public enum ActivityFlags
+ {
+ ///
+ /// Activity instance.
+ ///
+ Instance = 1 << 0,
+
+ ///
+ /// Activity join.
+ ///
+ Join = 1 << 1,
+
+ ///
+ /// Activity spectate.
+ ///
+ Spectate = 1 << 2,
+
+ ///
+ /// Activity join request.
+ ///
+ JoinRequest = 1 << 3,
+
+ ///
+ /// Activity sync.
+ ///
+ Sync = 1 << 4,
+
+ ///
+ /// Activity play.
+ ///
+ Play = 1 << 5,
+ }
+}
diff --git a/src/Models/Gateway/ActivityParty.cs b/src/Models/Gateway/ActivityParty.cs
new file mode 100644
index 000000000..4512941ab
--- /dev/null
+++ b/src/Models/Gateway/ActivityParty.cs
@@ -0,0 +1,34 @@
+using System.Text.Json.Serialization;
+
+namespace Discord.Net.Models
+{
+ ///
+ /// Represents an activity party object.
+ ///
+ public record ActivityParty
+ {
+ ///
+ /// Creates a with the provided parameters.
+ ///
+ /// The id of the party.
+ /// Used to show the party's current and maximum size.
+ [JsonConstructor]
+ public ActivityParty(Optional id, Optional size)
+ {
+ Id = id;
+ Size = size;
+ }
+
+ ///
+ /// The id of the party.
+ ///
+ [JsonPropertyName("id")]
+ public Optional Id { get; }
+
+ ///
+ /// Used to show the party's current and maximum size.
+ ///
+ [JsonPropertyName("size")]
+ public Optional Size { get; }
+ }
+}
diff --git a/src/Models/Gateway/ActivitySecrets.cs b/src/Models/Gateway/ActivitySecrets.cs
new file mode 100644
index 000000000..dcae2096f
--- /dev/null
+++ b/src/Models/Gateway/ActivitySecrets.cs
@@ -0,0 +1,42 @@
+using System.Text.Json.Serialization;
+
+namespace Discord.Net.Models
+{
+ ///
+ /// Represents an activity secrets object.
+ ///
+ public record ActivitySecrets
+ {
+ ///
+ /// Creates a with the provided parameters.
+ ///
+ /// The secret for joining a party.
+ /// The secret for spectating a game.
+ /// The secret for a specific instanced match.
+ [JsonConstructor]
+ public ActivitySecrets(Optional join, Optional spectate, Optional match)
+ {
+ Join = join;
+ Spectate = spectate;
+ Match = match;
+ }
+
+ ///
+ /// The secret for joining a party.
+ ///
+ [JsonPropertyName("join")]
+ public Optional Join { get; }
+
+ ///
+ /// The secret for spectating a game.
+ ///
+ [JsonPropertyName("spectate")]
+ public Optional Spectate { get; }
+
+ ///
+ /// The secret for a specific instanced match.
+ ///
+ [JsonPropertyName("match")]
+ public Optional Match { get; }
+ }
+}
diff --git a/src/Models/Gateway/ActivityTimestamps.cs b/src/Models/Gateway/ActivityTimestamps.cs
new file mode 100644
index 000000000..89f752a43
--- /dev/null
+++ b/src/Models/Gateway/ActivityTimestamps.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Text.Json.Serialization;
+
+namespace Discord.Net.Models
+{
+ ///
+ /// Represents an activity timestamp object.
+ ///
+ public record ActivityTimestamps
+ {
+ ///
+ /// Creates a with the provided parameters.
+ ///
+ /// When the activity started.
+ /// When the activity ends.
+ [JsonConstructor]
+ public ActivityTimestamps(Optional start, Optional end)
+ {
+ Start = start;
+ End = end;
+ }
+
+ ///
+ /// When the activity started.
+ ///
+ [JsonPropertyName("start")]
+ public Optional Start { get; }
+
+ ///
+ /// When the activity ends.
+ ///
+ [JsonPropertyName("end")]
+ public Optional End { get; }
+ }
+}
diff --git a/src/Models/Gateway/ActivityType.cs b/src/Models/Gateway/ActivityType.cs
new file mode 100644
index 000000000..150f627f5
--- /dev/null
+++ b/src/Models/Gateway/ActivityType.cs
@@ -0,0 +1,38 @@
+namespace Discord.Net.Models
+{
+ ///
+ /// Represents the activity type.
+ ///
+ public enum ActivityType
+ {
+ ///
+ /// Playing {name}.
+ ///
+ Game = 0,
+
+ ///
+ /// Streaming {details}.
+ ///
+ Streaming = 1,
+
+ ///
+ /// Listening to {name}.
+ ///
+ Listening = 2,
+
+ ///
+ /// Watching {name}.
+ ///
+ Watching = 3,
+
+ ///
+ /// {emoji} {name}.
+ ///
+ Custom = 4,
+
+ ///
+ /// Competing in {name}.
+ ///
+ Competing = 5,
+ }
+}
diff --git a/src/Models/Gateway/ClientStatus.cs b/src/Models/Gateway/ClientStatus.cs
new file mode 100644
index 000000000..4bd49f18b
--- /dev/null
+++ b/src/Models/Gateway/ClientStatus.cs
@@ -0,0 +1,42 @@
+using System.Text.Json.Serialization;
+
+namespace Discord.Net.Models
+{
+ ///
+ /// Represents a client status object.
+ ///
+ public record ClientStatus
+ {
+ ///
+ /// Creates a with the provided parameters.
+ ///
+ /// The user's status set for an active desktop (Windows, Linux, Mac) application session.
+ /// The user's status set for an active mobile (iOS, Android) application session.
+ /// The user's status set for an active web (browser, bot account) application session.
+ [JsonConstructor]
+ public ClientStatus(Optional desktop, Optional mobile, Optional web)
+ {
+ Desktop = desktop;
+ Mobile = mobile;
+ Web = web;
+ }
+
+ ///
+ /// The user's status set for an active desktop (Windows, Linux, Mac) application session.
+ ///
+ [JsonPropertyName("desktop")]
+ public Optional Desktop { get; }
+
+ ///
+ /// The user's status set for an active mobile (iOS, Android) application session.
+ ///
+ [JsonPropertyName("mobile")]
+ public Optional Mobile { get; }
+
+ ///
+ /// The user's status set for an active web (browser, bot account) application session.
+ ///
+ [JsonPropertyName("web")]
+ public Optional Web { get; }
+ }
+}
diff --git a/src/Models/Gateway/Presence.cs b/src/Models/Gateway/Presence.cs
new file mode 100644
index 000000000..7fb8bff12
--- /dev/null
+++ b/src/Models/Gateway/Presence.cs
@@ -0,0 +1,58 @@
+using System.Text.Json.Serialization;
+
+namespace Discord.Net.Models
+{
+ ///
+ /// Represents a presence object.
+ ///
+ public record Presence
+ {
+ ///
+ /// Creates a with the provided parameters.
+ ///
+ /// The user presence is being updated for.
+ /// Id of the guild.
+ /// Either "idle", "dnd", "online", or "offline".
+ /// User's current activities.
+ /// User's platform-dependent status.
+ [JsonConstructor]
+ public Presence(User user, Snowflake guildId, string status, Activity[] activities, ClientStatus clientStatus)
+ {
+ User = user;
+ GuildId = guildId;
+ Status = status;
+ Activities = activities;
+ ClientStatus = clientStatus;
+ }
+
+ ///
+ /// The user presence is being updated for.
+ ///
+ [JsonPropertyName("user")]
+ public User User { get; }
+
+ ///
+ /// Id of the guild.
+ ///
+ [JsonPropertyName("guild_id")]
+ public Snowflake GuildId { get; }
+
+ ///
+ /// Either "idle", "dnd", "online", or "offline".
+ ///
+ [JsonPropertyName("status")]
+ public string Status { get; }
+
+ ///
+ /// User's current activities.
+ ///
+ [JsonPropertyName("activities")]
+ public Activity[] Activities { get; }
+
+ ///
+ /// User's platform-dependent status.
+ ///
+ [JsonPropertyName("client_status")]
+ public ClientStatus ClientStatus { get; }
+ }
+}
diff --git a/src/Models/Guild/Guild.cs b/src/Models/Guild/Guild.cs
index 7de22b4ee..5c7c93c96 100644
--- a/src/Models/Guild/Guild.cs
+++ b/src/Models/Guild/Guild.cs
@@ -61,7 +61,7 @@ namespace Discord.Net.Models
/// Guild NSFW level.
/// Stage instances in the guild.
[JsonConstructor]
- public Guild(Snowflake id, string name, string? icon, Optional iconHash, string? splash, string? discoverySplash, Optional owner, Snowflake ownerId, Optional permissions, string region, Snowflake? afkChannelId, int afkTimeout, Optional widgetEnabled, Optional widgetChannelId, int verificationLevel, int defaultMessageNotifications, int explicitContentFilter, Role[] roles, Emoji[] emojis, string[] features, int mfaLevel, Snowflake? applicationId, Snowflake? systemChannelId, int systemChannelFlags, Snowflake? rulesChannelId, Optional joinedAt, Optional large, Optional unavailable, Optional memberCount, Optional voiceStates, Optional members, Optional channels, Optional threads, Optional presences, Optional maxPresences, Optional maxMembers, string? vanityUrlCode, string? description, string? banner, int premiumTier, Optional premiumSubscriptionCount, string preferredLocale, Snowflake? publicUpdatesChannelId, Optional maxVideoChannelUsers, Optional approximateMemberCount, Optional approximatePresenceCount, Optional welcomeScreen, int nsfwLevel, Optional stageInstances)
+ public Guild(Snowflake id, string name, string? icon, Optional iconHash, string? splash, string? discoverySplash, Optional owner, Snowflake ownerId, Optional permissions, string region, Snowflake? afkChannelId, int afkTimeout, Optional widgetEnabled, Optional widgetChannelId, int verificationLevel, int defaultMessageNotifications, int explicitContentFilter, Role[] roles, Emoji[] emojis, string[] features, int mfaLevel, Snowflake? applicationId, Snowflake? systemChannelId, int systemChannelFlags, Snowflake? rulesChannelId, Optional joinedAt, Optional large, Optional unavailable, Optional memberCount, Optional voiceStates, Optional members, Optional channels, Optional threads, Optional presences, Optional maxPresences, Optional maxMembers, string? vanityUrlCode, string? description, string? banner, int premiumTier, Optional premiumSubscriptionCount, string preferredLocale, Snowflake? publicUpdatesChannelId, Optional maxVideoChannelUsers, Optional approximateMemberCount, Optional approximatePresenceCount, Optional welcomeScreen, int nsfwLevel, Optional stageInstances)
{
Id = id;
Name = name;
@@ -316,7 +316,7 @@ namespace Discord.Net.Models
/// Presences of the members in the guild, will only include non-offline members if the size is greater than large threshold.
///
[JsonPropertyName("presences")]
- public Optional Presences { get; }
+ public Optional Presences { get; }
///
/// The maximum number of presences for the guild (the default value, currently 25000, is in effect when null is returned).