Browse Source

Cleanup several articles to be more human-friendly and easier to read

pull/1161/head
Still Hsu 7 years ago
parent
commit
8548fbc9a0
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
3 changed files with 39 additions and 52 deletions
  1. +5
    -5
      docs/guides/getting_started/first-bot.md
  2. +29
    -43
      docs/guides/getting_started/installing.md
  3. +5
    -4
      docs/guides/introduction/intro.md

+ 5
- 5
docs/guides/getting_started/first-bot.md View File

@@ -173,11 +173,11 @@ The following lines can now be added:
At this point, feel free to start your program and see your bot come
online in Discord.

> [!NOTE]
> Getting a warning saying `A supplied token was invalid.` and having
> trouble with logging in? Double-check whether you put in the correct
> credentials. Note that a client secret is not the same as a bot
> token!
> [!TIP]
> Getting a warning about `A supplied token was invalid.` and/or
> having trouble logging in? Double-check whether you have put in
> the correct credentials and make sure that it is _not_ a client
> secret, which is different from a token.

> [!TIP]
> Encountering a `PlatformNotSupportedException` when starting your bot?


+ 29
- 43
docs/guides/getting_started/installing.md View File

@@ -5,31 +5,27 @@ title: Installing Discord.Net

# Discord.Net Installation

Discord.Net is distributed through the NuGet package manager, so it is
recommended for you to install the library that way.

Alternatively, you may compile from the source and install the library
yourself.
Discord.Net is distributed through the NuGet package manager; the most
recommended way for you to install this library. Alternatively, you
may also compile this library yourself should you so desire.

## Supported Platforms

Currently, Discord.Net targets [.NET Standard] 1.3 and 2.0.

Since Discord.Net is built on top of .NET Standard, it is also
recommended to create applications using [.NET Core],
although it is not required.

When using .NET Framework, it is suggested to
target `.NET Framework 4.6.1` or higher.
Discord.Net targets [.NET Standard] both 1.3 and 2.0; this also means
that creating applications using the latest version of [.NET Core] is
the most recommended. If you are bound by Windows-specific APIs or
other limitations, you may also consider targeting [.NET Framework]
4.6.1 or higher.

> [!WARNING]
> Using this library with [Mono] is not recommended until further
> Using this library with [Mono] is not supported until further
> notice. It is known to have issues with the library's WebSockets
> implementation and may crash the application upon startup.

[Mono]: https://www.mono-project.com/
[.NET Standard]: https://docs.microsoft.com/en-us/dotnet/articles/standard/library
[.NET Core]: https://docs.microsoft.com/en-us/dotnet/articles/core/
[.NET Framework]: https://docs.microsoft.com/en-us/dotnet/framework/get-started/
[additional steps]: #installing-on-net-standard-11

## Installing with NuGet
@@ -89,8 +85,8 @@ In order to compile Discord.Net, you will need the following:
* [Visual Studio 2017](https://www.visualstudio.com/)
* [.NET Core SDK]

The .NET Core and Docker (Preview) workload is required during Visual
Studio installation.
The .NET Core and Docker workload is required during Visual Studio
installation.

### Using Command Line

@@ -100,45 +96,35 @@ Studio installation.

### Installing on Unsupported WebSocket Platform

For an older operating system such as Windows 7 or earlier that does
not natively support WebSocket, you may encounter
@System.PlatformNotSupportedException upon connection.
When running any Discord.Net-powered bot on an older operating system
(e.g. Windows 7) that does not natively support WebSocket,
you may encounter a @System.PlatformNotSupportedException upon
connecting.

You may resolve this by either targeting .NET Core 2.1 or later, or
by installing one or more custom packages as listed below.

#### [Targeting .NET Core 2.1](#tab/core2-1)

First, make sure your installed SDK supports .NET Core 2.1.
Enter `dotnet --version`; the version number should be equal to or
above `2.1.300`. If not, visit the [.NET Core SDK] website to download
the latest version.

Next, ensure your project is set to target Core 2.1; you should replace
the `<TargetFramework>` tag in your project file to `netcoreapp2.1` or
above. Alternatively, you may specify the target framework upon build
using the `-f` or `--framework` parameter.

* For example, `dotnet build -c Release -f netcoreapp2.1`
1. Download the latest [.NET Core SDK].
2. Create or move your existing project to use .NET Core.
3. Modify your `<TargetFramework>` tag to at least `netcoreapp2.1`, or
by adding the `--framework netcoreapp2.1` switch when building.

#### [Custom Packages](#tab/custom-pkg)

First, install the following packages through NuGet, or, if you prefer
compile them yourself:

* `Discord.Net.Providers.WS4Net`
* `Discord.Net.Providers.UDPClient`
1. Install or compile the following packages:

> [!NOTE]
> `Discord.Net.Providers.UDPClient` is _only_ required if your
> bot will be utilizing voice chat.
* `Discord.Net.Providers.WS4Net`
* `Discord.Net.Providers.UDPClient` (Optional)
* This is _only_ required if your bot will be utilizing voice chat.

Next, you will need to configure your [DiscordSocketClient] to use
these custom providers over the default ones.
2. Configure your [DiscordSocketClient] to use these custom providers
over the default ones.

To do this, set the `WebSocketProvider` and the optional
`UdpSocketProvider` properties on the [DiscordSocketConfig] that you
are passing into your client.
* To do this, set the `WebSocketProvider` and the optional
`UdpSocketProvider` properties on the [DiscordSocketConfig] that you
are passing into your client.

[!code-csharp[Example](samples/netstd11.cs)]



+ 5
- 4
docs/guides/introduction/intro.md View File

@@ -7,13 +7,14 @@ title: Introduction to Discord.Net

## Looking to get started?

First of all, welcome! You may visit us on our Discord should you
have any questions. Before you delve into using the library,
however, you should have some decent understanding of the language
Welcome! Before you dive into this library, however, you should have
some decent understanding of the language
you are about to use. This library touches on
[Task-based Asynchronous Pattern] \(TAP), [polymorphism], [interface]
and many more advanced topics extensively. Please make sure that you
understand these topics to some extent before proceeding.
understand these topics to some extent before proceeding. With all
that being said, feel free to visit us on Discord at the link below
if you have any questions!

Here are some examples:



Loading…
Cancel
Save