From bf493ea04007fcf186bdb3d80e3b6993c25d9eef Mon Sep 17 00:00:00 2001 From: Armano den Boef <68127614+Rozen4334@users.noreply.github.com> Date: Mon, 1 Aug 2022 21:47:53 +0200 Subject: [PATCH] feat: Labs deprecation & readme expansion (#2406) --- CONTRIBUTING.md | 3 +- README.md | 83 ++++++++++++++-------- docs/faq/basics/client-basics.md | 2 +- docs/guides/getting_started/installing.md | 20 ++++-- docs/guides/getting_started/labs.md | 30 -------- docs/guides/getting_started/terminology.md | 12 ++-- docs/guides/toc.yml | 3 - docs/guides/v2_v3_guide/v2_to_v3_guide.md | 2 +- 8 files changed, 78 insertions(+), 77 deletions(-) delete mode 100644 docs/guides/getting_started/labs.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 840650cf8..1455267f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,8 +7,7 @@ following guidelines when possible: ## Development Cycle We prefer all changes to the library to be discussed beforehand, -either in a GitHub issue, or in a discussion in our Discord channel -with library regulars or other contributors. +either in a GitHub issue, or in a discussion in our [Discord server](https://discord.gg/dnet) Issues that are tagged as "up for grabs" are free to be picked up by any member of the community. diff --git a/README.md b/README.md index e85216dbf..7b98a5f41 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@

Discord.Net is an unofficial .NET API Wrapper for the Discord client (https://discord.com). -## Documentation +## 📄 Documentation -- [Nightly](https://discordnet.dev) +- https://discordnet.dev -## Installation +## 📥 Installation ### Stable (NuGet) @@ -33,55 +33,78 @@ Our stable builds available from NuGet through the Discord.Net metapackage: The individual components may also be installed from NuGet: -- [Discord.Net.Commands](https://www.nuget.org/packages/Discord.Net.Commands/) -- [Discord.Net.Rest](https://www.nuget.org/packages/Discord.Net.Rest/) -- [Discord.Net.WebSocket](https://www.nuget.org/packages/Discord.Net.WebSocket/) -- [Discord.Net.Webhook](https://www.nuget.org/packages/Discord.Net.Webhook/) +- _Webhooks_ + - [Discord.Net.Webhook](https://www.nuget.org/packages/Discord.Net.Webhook/) -### Unstable (MyGet) +- _Text-Command & Interaction services._ + - [Discord.Net.Commands](https://www.nuget.org/packages/Discord.Net.Commands/) + - [Discord.Net.Interactions](https://www.nuget.org/packages/Discord.Net.Interactions/) -Nightly builds are available through our MyGet feed (`https://www.myget.org/F/discord-net/api/v3/index.json`). +- _Complete API coverage._ + - [Discord.Net.WebSocket](https://www.nuget.org/packages/Discord.Net.WebSocket/) + - [Discord.Net.Rest](https://www.nuget.org/packages/Discord.Net.Rest/) -### Unstable (Labs) +- _The API core. Implements only entities and barebones functionality._ + - [Discord.Net.Core](https://www.nuget.org/packages/Discord.Net.Core/) -Labs builds are available on nuget (`https://www.nuget.org/packages/Discord.Net.Labs/`) and myget (`https://www.myget.org/F/discord-net-labs/api/v3/index.json`). +### Unstable -## Compiling +Nightly builds are available through our MyGet feed (`https://www.myget.org/F/discord-net/api/v3/index.json`). +These builds target the dev branch. -In order to compile Discord.Net, you require the following: +## 🛑 Known Issues -### Using Visual Studio +### WebSockets (Win7 and earlier) -- [Visual Studio 2017](https://www.microsoft.com/net/core#windowsvs2017) -- [.NET Core SDK](https://www.microsoft.com/net/download/core) +.NET Core 1.1 does not support WebSockets on Win7 and earlier. +This issue has been fixed since the release of .NET Core 2.1. +It is recommended to target .NET Core 2.1 or above for your project if you wish to run your bot on legacy platforms; +alternatively, you may choose to install the +[Discord.Net.Providers.WS4Net](https://www.nuget.org/packages/Discord.Net.Providers.WS4Net/) package. -The .NET Core workload must be selected during Visual Studio installation. +### TLS on .NET Framework. -### Using Command Line +Discord supports only TLS1.2+ on all their websites including the API since 07/19/2022. +.NET Framework does not support this protocol by default. +If you depend on .NET Framework, it is suggested to upgrade your project to `net6-windows`. +This framework supports most of the windows-only features introduced by fx, and resolves startup errors from the TLS protocol mismatch. -- [.NET Core SDK](https://www.microsoft.com/net/download/core) +## 🗃️ Versioning Guarantees -## Known Issues +This library generally abides by [Semantic Versioning](https://semver.org). Packages are published in `MAJOR.MINOR.PATCH` version format. -### WebSockets (Win7 and earlier) +### Patch component -.NET Core 1.1 does not support WebSockets on Win7 and earlier. This issue has been fixed since the release of .NET Core 2.1. It is recommended to target .NET Core 2.1 or above for your project if you wish to run your bot on legacy platforms; alternatively, you may choose to install the [Discord.Net.Providers.WS4Net](https://www.nuget.org/packages/Discord.Net.Providers.WS4Net/) package. +An increment of the **PATCH** component always indicates that an internal-only change was made, generally a bugfix. These changes will not affect the public-facing API in any way, and are always guaranteed to be forward- and backwards-compatible with your codebase, any pre-compiled dependencies of your codebase. -## Versioning Guarantees +### Minor component -This library generally abides by [Semantic Versioning](https://semver.org). Packages are published in MAJOR.MINOR.PATCH version format. +An increment of the **MINOR** component indicates that some addition was made to the library, +and this addition is not backwards-compatible with prior versions. +However, Discord.Net **does not guarantee forward-compatibility** on minor additions. +In other words, we permit a limited set of breaking changes on a minor version bump. -An increment of the PATCH component always indicates that an internal-only change was made, generally a bugfix. These changes will not affect the public-facing API in any way, and are always guaranteed to be forward- and backwards-compatible with your codebase, any pre-compiled dependencies of your codebase. +Due to the nature of the Discord API, we will oftentimes need to add a property to an entity to support the latest API changes. +Discord.Net provides interfaces as a method of consuming entities; and as such, introducing a new field to an entity is technically a breaking change. +Major version bumps generally indicate some major change to the library, +and as such we are hesitant to bump the major version for every minor addition to the library. +To compromise, we have decided that interfaces should be treated as **consumable only**, +and your applications should typically not be implementing interfaces. -An increment of the MINOR component indicates that some addition was made to the library, and this addition is not backwards-compatible with prior versions. However, Discord.Net **does not guarantee forward-compatibility** on minor additions. In other words, we permit a limited set of breaking changes on a minor version bump. +> For applications where interfaces are implemented, such as in test mocks, we apologize for this inconsistency with SemVer. -Due to the nature of the Discord API, we will oftentimes need to add a property to an entity to support the latest API changes. Discord.Net provides interfaces as a method of consuming entities; and as such, introducing a new field to an entity is technically a breaking change. Major version bumps generally indicate some major change to the library, and as such we are hesitant to bump the major version for every minor addition to the library. To compromise, we have decided that interfaces should be treated as **consumable only**, and your applications should typically not be implementing interfaces. (For applications where interfaces are implemented, such as in test mocks, we apologize for this inconsistency with SemVer). +While we will never break the API (outside of interface changes) on minor builds, +we will occasionally need to break the ABI, by introducing parameters to a method to match changes upstream with Discord. +As such, a minor version increment may require you to recompile your code, and dependencies, +such as addons, may also need to be recompiled and republished on the newer version. +When a binary breaking change is made, the change will be noted in the release notes. -Furthermore, while we will never break the API (outside of interface changes) on minor builds, we will occasionally need to break the ABI, by introducing parameters to a method to match changes upstream with Discord. As such, a minor version increment may require you to recompile your code, and dependencies, such as addons, may also need to be recompiled and republished on the newer version. When a binary breaking change is made, the change will be noted in the release notes. +### Major component -An increment of the MAJOR component indicates that breaking changes have been made to the library; consumers should check the release notes to determine what changes need to be made. +An increment of the **MAJOR** component indicates that breaking changes have been made to the library; +consumers should check the release notes to determine what changes need to be made. -## Branches +## 📚 Branches ### Release/X.X diff --git a/docs/faq/basics/client-basics.md b/docs/faq/basics/client-basics.md index ade33c35d..3f21dd165 100644 --- a/docs/faq/basics/client-basics.md +++ b/docs/faq/basics/client-basics.md @@ -36,7 +36,7 @@ _client = new DiscordSocketClient(config); This includes intents that receive messages such as: `GatewayIntents.GuildMessages, GatewayIntents.DirectMessages` - GuildMembers: An intent disabled by default, as you need to enable it in the [developer portal]. - GuildPresences: Also disabled by default, this intent together with `GuildMembers` are the only intents not included in `AllUnprivileged`. -- All: All intents, it is ill adviced to use this without care, as it *can* cause a memory leak from presence. +- All: All intents, it is ill advised to use this without care, as it _can_ cause a memory leak from presence. The library will give responsive warnings if you specify unnecessary intents. diff --git a/docs/guides/getting_started/installing.md b/docs/guides/getting_started/installing.md index 0dde72380..d07787b67 100644 --- a/docs/guides/getting_started/installing.md +++ b/docs/guides/getting_started/installing.md @@ -30,17 +30,25 @@ other limitations, you may also consider targeting [.NET Framework] [.net framework]: https://docs.microsoft.com/en-us/dotnet/framework/get-started/ [additional steps]: #installing-on-net-standard-11 -## Installing with NuGet +## Installing Release builds of Discord.Net will be published to the [official NuGet feed]. -Development builds of Discord.Net, as well as add-ons, will be -published to our [MyGet feed]. See -@Guides.GettingStarted.Installation.Nightlies to learn more. +### Experimental/Development -[official nuget feed]: https://nuget.org -[myget feed]: https://www.myget.org/feed/Packages/discord-net +Development builds of Discord.Net will be +published to our [MyGet feed]. The MyGet feed can be used to run the latest dev branch builds. +It is not advised to use MyGet packages in a production environment, as changes may be made that negatively affect certain library functions. + +### Labs + +This exterior branch of Discord.Net has been deprecated and is no longer supported. +If you have used Discord.Net-Labs in the past, you are advised to update to the latest version of Discord.Net. +All features in Labs are implemented in the main repository. + +[official NuGet feed]: https://nuget.org +[MyGet feed]: https://www.myget.org/feed/Packages/discord-net ### [Using Visual Studio](#tab/vs-install) diff --git a/docs/guides/getting_started/labs.md b/docs/guides/getting_started/labs.md deleted file mode 100644 index e52014312..000000000 --- a/docs/guides/getting_started/labs.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -uid: Guides.GettingStarted.Installation.Labs -title: Installing Labs builds ---- - -# Installing Discord.NET Labs - -Discord.NET Labs is the experimental repository that introduces new features & chips away at all bugs until ready for merging into Discord.NET. -Are you looking to test or play with new features? - -> [!IMPORTANT] -> It is very ill advised to use Discord.NET Labs in a production environment normally, -> considering it can include bugs that have not been discovered yet, as features are freshly added. -> However if approached correctly, will work as a pre-release to Discord.NET. -> Make sure to report any bugs at the Labs [repository] or on [Discord] - -[Discord]: https://discord.gg/dnet -[repository]: https://github.com/Discord-Net-Labs/Discord.Net-Labs - -## Installation: - -[NuGet] - This only includes releases, on which features are ready to test. - -> [!NOTE] -> Installing NuGet packages is covered fully at [Installing Discord NET](xref:Guides.GettingStarted.Installation) - -[MyGet] - Available for current builds and unreleased features. - -[NuGet]: https://www.nuget.org/packages/Discord.Net.Labs/ -[MyGet]: https://www.myget.org/feed/Packages/discord-net-labs diff --git a/docs/guides/getting_started/terminology.md b/docs/guides/getting_started/terminology.md index 0f24edd6f..facf1c790 100644 --- a/docs/guides/getting_started/terminology.md +++ b/docs/guides/getting_started/terminology.md @@ -8,18 +8,22 @@ title: Terminology ## Preface Most terms for objects remain the same between 0.9 and 1.0 and above. -The major difference is that the ``Server`` is now called ``Guild`` +The major difference is that the `Server` is now called `Guild` to stay in line with Discord internally. ## Implementation Specific Entities Discord.Net is split into a core library and two different implementations - `Discord.Net.Core`, `Discord.Net.Rest`, and -`Discord.Net.WebSockets`. +`Discord.Net.WebSocket`. -As a bot developer, you will only need to use `Discord.Net.WebSockets`, +You will typically only need to use `Discord.Net.WebSocket`, but you should be aware of the differences between them. +> [!TIP] +> If you are looking to implement Rest based interactions, or handle calls over REST in any other way, +> `Discord.Net.Rest` is the resource most applicable to you. + `Discord.Net.Core` provides a set of interfaces that models Discord's API. These interfaces are consistent throughout all implementations of Discord.Net, and if you are writing an implementation-agnostic library @@ -33,4 +37,4 @@ implementation are prefixed with `Rest` (e.g., `RestChannel`). `Discord.Net.WebSocket` provides a set of concrete classes that are used primarily with Discord's WebSocket API or entities that are kept in cache. When developing bots, you will be using this implementation. -All entities are prefixed with `Socket` (e.g., `SocketChannel`). \ No newline at end of file +All entities are prefixed with `Socket` (e.g., `SocketChannel`). diff --git a/docs/guides/toc.yml b/docs/guides/toc.yml index f122ea6ba..45f3983af 100644 --- a/docs/guides/toc.yml +++ b/docs/guides/toc.yml @@ -6,9 +6,6 @@ items: - name: Installation topicUid: Guides.GettingStarted.Installation - items: - - name: Nightly builds - topicUid: Guides.GettingStarted.Installation.Labs - name: Your First Bot topicUid: Guides.GettingStarted.FirstBot - name: Terminology diff --git a/docs/guides/v2_v3_guide/v2_to_v3_guide.md b/docs/guides/v2_v3_guide/v2_to_v3_guide.md index 6b4fa5282..a837f44d2 100644 --- a/docs/guides/v2_v3_guide/v2_to_v3_guide.md +++ b/docs/guides/v2_v3_guide/v2_to_v3_guide.md @@ -38,7 +38,7 @@ _client = new DiscordSocketClient(config); This includes intents that receive messages such as: `GatewayIntents.GuildMessages, GatewayIntents.DirectMessages` - GuildMembers: An intent disabled by default, as you need to enable it in the [developer portal]. - GuildPresences: Also disabled by default, this intent together with `GuildMembers` are the only intents not included in `AllUnprivileged`. -- All: All intents, it is ill adviced to use this without care, as it _can_ cause a memory leak from presence. +- All: All intents, it is ill advised to use this without care, as it _can_ cause a memory leak from presence. The library will give responsive warnings if you specify unnecessary intents. > [!NOTE]