* Trim whitespace from tokens before logging in This change trims whitespace characters from the supplied token before it is used to log in. Users can encounter this accidentally if they read their token from a file that ends with a blank line. Leading whitespace will make the token invalid. Trailing whitespace or \n (not \r\n) will also fail to log in. \r\n (CRLF) doesn't fail because of the line break style for http request headers. * revert trimming api token * add check for whitespace or newline characters to existing token validation Checks to see if a token contains any illegal characters, like whitespace or a newline. If it is, throws an ArgumentException warning the user that their token may be invalid. I considered only checking the first and last character, but given that a token containing whitespace or a newline wouldn't work either I figured this made sense. * removed unused usings These were leftover from a previous approach using an ImmutableHashSet
Discord.Net
An unofficial .NET API Wrapper for the Discord client (http://discordapp.com).
Check out the documentation or join the Discord API Chat.
Installation
Stable (NuGet)
Our stable builds available from NuGet through the Discord.Net metapackage:
The individual components may also be installed from NuGet:
Unstable (MyGet)
Nightly builds are available through our MyGet feed (https://www.myget.org/F/discord-net/api/v3/index.json).
Compiling
In order to compile Discord.Net, you require the following:
Using Visual Studio
The .NET Core workload must be selected during Visual Studio installation.
Using Command Line
Known Issues
WebSockets (Win7 and earlier)
.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 package.
