diff --git a/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs b/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
index 0e634ad1a..aec894d21 100644
--- a/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
+++ b/src/Discord.Net.Core/Entities/Permissions/OverwritePermissions.cs
@@ -1,4 +1,3 @@
-using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -19,7 +18,7 @@ namespace Discord
/// Gets a that grants all permissions for the given channel.
///
/// Unknown channel type.
- public static OverwritePermissions AllowAll(IChannel channel)
+ public static OverwritePermissions AllowAll(IChannel channel)
=> new OverwritePermissions(ChannelPermissions.All(channel).RawValue, 0);
///
/// Gets a that denies all permissions for the given channel.
@@ -116,24 +115,24 @@ namespace Discord
private OverwritePermissions(ulong allowValue, ulong denyValue,
PermValue? createInstantInvite = null,
- PermValue? manageChannel = null,
+ PermValue? manageChannel = null,
PermValue? addReactions = null,
PermValue? viewChannel = null,
PermValue? sendMessages = null,
PermValue? sendTTSMessages = null,
- PermValue? manageMessages = null,
+ PermValue? manageMessages = null,
PermValue? embedLinks = null,
PermValue? attachFiles = null,
PermValue? readMessageHistory = null,
- PermValue? mentionEveryone = null,
+ PermValue? mentionEveryone = null,
PermValue? useExternalEmojis = null,
PermValue? connect = null,
PermValue? speak = null,
- PermValue? muteMembers = null,
+ PermValue? muteMembers = null,
PermValue? deafenMembers = null,
PermValue? moveMembers = null,
PermValue? useVoiceActivation = null,
- PermValue? manageRoles = null,
+ PermValue? manageRoles = null,
PermValue? manageWebhooks = null,
PermValue? prioritySpeaker = null,
PermValue? stream = null,
@@ -194,7 +193,7 @@ namespace Discord
PermValue viewChannel = PermValue.Inherit,
PermValue sendMessages = PermValue.Inherit,
PermValue sendTTSMessages = PermValue.Inherit,
- PermValue manageMessages = PermValue.Inherit,
+ PermValue manageMessages = PermValue.Inherit,
PermValue embedLinks = PermValue.Inherit,
PermValue attachFiles = PermValue.Inherit,
PermValue readMessageHistory = PermValue.Inherit,
@@ -221,8 +220,8 @@ namespace Discord
PermValue useExternalStickers = PermValue.Inherit,
PermValue sendMessagesInThreads = PermValue.Inherit,
PermValue startEmbeddedActivities = PermValue.Inherit)
- : this(0, 0, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
- embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers,
+ : this(0, 0, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
+ embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers,
moveMembers, useVoiceActivation, manageRoles, manageWebhooks, prioritySpeaker, stream, useSlashCommands, useApplicationCommands,
requestToSpeak, manageThreads, createPublicThreads, createPrivateThreads, usePublicThreads, usePrivateThreads, useExternalStickers,
sendMessagesInThreads, startEmbeddedActivities) { }
@@ -238,11 +237,11 @@ namespace Discord
PermValue? viewChannel = null,
PermValue? sendMessages = null,
PermValue? sendTTSMessages = null,
- PermValue? manageMessages = null,
+ PermValue? manageMessages = null,
PermValue? embedLinks = null,
PermValue? attachFiles = null,
PermValue? readMessageHistory = null,
- PermValue? mentionEveryone = null,
+ PermValue? mentionEveryone = null,
PermValue? useExternalEmojis = null,
PermValue? connect = null,
PermValue? speak = null,
@@ -265,8 +264,8 @@ namespace Discord
PermValue? useExternalStickers = null,
PermValue? sendMessagesInThreads = null,
PermValue? startEmbeddedActivities = null)
- => new OverwritePermissions(AllowValue, DenyValue, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
- embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers,
+ => new OverwritePermissions(AllowValue, DenyValue, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
+ embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers,
moveMembers, useVoiceActivation, manageRoles, manageWebhooks, prioritySpeaker, stream, useSlashCommands, useApplicationCommands,
requestToSpeak, manageThreads, createPublicThreads, createPrivateThreads, usePublicThreads, usePrivateThreads, useExternalStickers,
sendMessagesInThreads, startEmbeddedActivities);
@@ -305,7 +304,7 @@ namespace Discord
}
public override string ToString() => $"Allow {AllowValue}, Deny {DenyValue}";
- private string DebuggerDisplay =>
+ private string DebuggerDisplay =>
$"Allow {string.Join(", ", ToAllowList())}, " +
$"Deny {string.Join(", ", ToDenyList())}";
}
diff --git a/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs b/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs
index 9a7eb80dd..6a42113e1 100644
--- a/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs
+++ b/src/Discord.Net.Rest/API/Common/ActionRowComponent.cs
@@ -1,14 +1,14 @@
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
using System.Linq;
namespace Discord.API
{
internal class ActionRowComponent : IMessageComponent
{
- [JsonProperty("type")]
+ [JsonPropertyName("type")]
public ComponentType Type { get; set; }
- [JsonProperty("components")]
+ [JsonPropertyName("components")]
public IMessageComponent[] Components { get; set; }
internal ActionRowComponent() { }
diff --git a/src/Discord.Net.Rest/API/Common/AllowedMentions.cs b/src/Discord.Net.Rest/API/Common/AllowedMentions.cs
index 7737a464f..d8825def4 100644
--- a/src/Discord.Net.Rest/API/Common/AllowedMentions.cs
+++ b/src/Discord.Net.Rest/API/Common/AllowedMentions.cs
@@ -1,17 +1,17 @@
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
namespace Discord.API
{
internal class AllowedMentions
{
- [JsonProperty("parse")]
+ [JsonPropertyName("parse")]
public Optional Parse { get; set; }
// Roles and Users have a max size of 100
- [JsonProperty("roles")]
+ [JsonPropertyName("roles")]
public Optional Roles { get; set; }
- [JsonProperty("users")]
+ [JsonPropertyName("users")]
public Optional Users { get; set; }
- [JsonProperty("replied_user")]
+ [JsonPropertyName("replied_user")]
public Optional RepliedUser { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/Application.cs b/src/Discord.Net.Rest/API/Common/Application.cs
index 62a1d9688..ce36664c3 100644
--- a/src/Discord.Net.Rest/API/Common/Application.cs
+++ b/src/Discord.Net.Rest/API/Common/Application.cs
@@ -1,36 +1,36 @@
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
namespace Discord.API
{
internal class Application
{
- [JsonProperty("description")]
+ [JsonPropertyName("description")]
public string Description { get; set; }
- [JsonProperty("rpc_origins")]
+ [JsonPropertyName("rpc_origins")]
public Optional RPCOrigins { get; set; }
- [JsonProperty("name")]
+ [JsonPropertyName("name")]
public string Name { get; set; }
- [JsonProperty("id")]
+ [JsonPropertyName("id")]
public ulong Id { get; set; }
- [JsonProperty("icon")]
+ [JsonPropertyName("icon")]
public string Icon { get; set; }
- [JsonProperty("bot_public")]
+ [JsonPropertyName("bot_public")]
public bool IsBotPublic { get; set; }
- [JsonProperty("bot_require_code_grant")]
+ [JsonPropertyName("bot_require_code_grant")]
public bool BotRequiresCodeGrant { get; set; }
- [JsonProperty("install_params")]
+ [JsonPropertyName("install_params")]
public Optional InstallParams { get; set; }
- [JsonProperty("team")]
+ [JsonPropertyName("team")]
public Team Team { get; set; }
- [JsonProperty("flags"), Int53]
+ [JsonPropertyName("flags"), Int53]
public Optional Flags { get; set; }
- [JsonProperty("owner")]
+ [JsonPropertyName("owner")]
public Optional Owner { get; set; }
- [JsonProperty("tags")]
+ [JsonPropertyName("tags")]
public Optional Tags { get; set; }
- [JsonProperty("terms_of_service_url")]
+ [JsonPropertyName("terms_of_service_url")]
public string TermsOfService { get; set; }
- [JsonProperty("privacy_policy_url")]
+ [JsonPropertyName("privacy_policy_url")]
public string PrivacyPolicy { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommand.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommand.cs
index e46369277..226deb04b 100644
--- a/src/Discord.Net.Rest/API/Common/ApplicationCommand.cs
+++ b/src/Discord.Net.Rest/API/Common/ApplicationCommand.cs
@@ -1,48 +1,48 @@
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
using System.Collections.Generic;
namespace Discord.API
{
internal class ApplicationCommand
{
- [JsonProperty("id")]
+ [JsonPropertyName("id")]
public ulong Id { get; set; }
- [JsonProperty("type")]
+ [JsonPropertyName("type")]
public ApplicationCommandType Type { get; set; } = ApplicationCommandType.Slash; // defaults to 1 which is slash.
- [JsonProperty("application_id")]
+ [JsonPropertyName("application_id")]
public ulong ApplicationId { get; set; }
- [JsonProperty("name")]
+ [JsonPropertyName("name")]
public string Name { get; set; }
- [JsonProperty("description")]
+ [JsonPropertyName("description")]
public string Description { get; set; }
- [JsonProperty("options")]
+ [JsonPropertyName("options")]
public Optional Options { get; set; }
- [JsonProperty("default_permission")]
+ [JsonPropertyName("default_permission")]
public Optional DefaultPermissions { get; set; }
- [JsonProperty("name_localizations")]
+ [JsonPropertyName("name_localizations")]
public Optional> NameLocalizations { get; set; }
- [JsonProperty("description_localizations")]
+ [JsonPropertyName("description_localizations")]
public Optional> DescriptionLocalizations { get; set; }
- [JsonProperty("name_localized")]
+ [JsonPropertyName("name_localized")]
public Optional NameLocalized { get; set; }
- [JsonProperty("description_localized")]
+ [JsonPropertyName("description_localized")]
public Optional DescriptionLocalized { get; set; }
-
+
// V2 Permissions
- [JsonProperty("dm_permission")]
+ [JsonPropertyName("dm_permission")]
public Optional DmPermission { get; set; }
- [JsonProperty("default_member_permissions")]
+ [JsonPropertyName("default_member_permissions")]
public Optional DefaultMemberPermission { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs
index a98ed77d6..ac952f0a4 100644
--- a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs
+++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs
@@ -1,22 +1,22 @@
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
namespace Discord.API
{
internal class ApplicationCommandInteractionData : IResolvable, IDiscordInteractionData
{
- [JsonProperty("id")]
+ [JsonPropertyName("id")]
public ulong Id { get; set; }
- [JsonProperty("name")]
+ [JsonPropertyName("name")]
public string Name { get; set; }
- [JsonProperty("options")]
+ [JsonPropertyName("options")]
public Optional Options { get; set; }
- [JsonProperty("resolved")]
+ [JsonPropertyName("resolved")]
public Optional Resolved { get; set; }
- [JsonProperty("type")]
+ [JsonPropertyName("type")]
public ApplicationCommandType Type { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs
index 1e488c4e6..b180273c6 100644
--- a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs
+++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs
@@ -1,19 +1,19 @@
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
namespace Discord.API
{
internal class ApplicationCommandInteractionDataOption
{
- [JsonProperty("name")]
+ [JsonPropertyName("name")]
public string Name { get; set; }
- [JsonProperty("type")]
+ [JsonPropertyName("type")]
public ApplicationCommandOptionType Type { get; set; }
- [JsonProperty("value")]
+ [JsonPropertyName("value")]
public Optional