diff --git a/Discord.Net.sln b/Discord.Net.sln index cd53f25b6..54a788f7d 100644 --- a/Discord.Net.sln +++ b/Discord.Net.sln @@ -36,7 +36,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Discord.Net.Tests.Integrati EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C7CF5621-7D36-433B-B337-5A2E3C101A71}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Discord.Net.Analyzers.Tests", "test\Discord.Net.Analyzers.Tests\Discord.Net.Analyzers.Tests.csproj", "{FC67057C-E92F-4E1C-98BE-46F839C8AD71}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Discord.Net.Analyzers.Tests", "test\Discord.Net.Analyzers.Tests\Discord.Net.Analyzers.Tests.csproj", "{FC67057C-E92F-4E1C-98BE-46F839C8AD71}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Discord.Net.Examples", "src\Discord.Net.Examples\Discord.Net.Examples.csproj", "{47820065-3CFB-401C-ACEA-862BD564A404}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -204,6 +206,18 @@ Global {FC67057C-E92F-4E1C-98BE-46F839C8AD71}.Release|x64.Build.0 = Release|Any CPU {FC67057C-E92F-4E1C-98BE-46F839C8AD71}.Release|x86.ActiveCfg = Release|Any CPU {FC67057C-E92F-4E1C-98BE-46F839C8AD71}.Release|x86.Build.0 = Release|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Debug|x64.ActiveCfg = Debug|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Debug|x64.Build.0 = Debug|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Debug|x86.ActiveCfg = Debug|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Debug|x86.Build.0 = Debug|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Release|Any CPU.ActiveCfg = Release|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Release|Any CPU.Build.0 = Release|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Release|x64.ActiveCfg = Release|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Release|x64.Build.0 = Release|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Release|x86.ActiveCfg = Release|Any CPU + {47820065-3CFB-401C-ACEA-862BD564A404}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -221,6 +235,7 @@ Global {DBF8B16E-5967-4480-8EDE-15D98A0DF0C4} = {C7CF5621-7D36-433B-B337-5A2E3C101A71} {E169E15A-E82C-45BF-8C24-C2CADB7093AA} = {C7CF5621-7D36-433B-B337-5A2E3C101A71} {FC67057C-E92F-4E1C-98BE-46F839C8AD71} = {C7CF5621-7D36-433B-B337-5A2E3C101A71} + {47820065-3CFB-401C-ACEA-862BD564A404} = {BB59D5B5-E7B0-4BF4-8F82-D14431B2799B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D2404771-EEC8-45F2-9D71-F3373F6C1495} diff --git a/docs/_template/description-generator/plugins/DocFX.Plugin.DescriptionGenerator.dll b/docs/_template/description-generator/plugins/DocFX.Plugin.DescriptionGenerator.dll index 644e9220e..095ea46ef 100644 Binary files a/docs/_template/description-generator/plugins/DocFX.Plugin.DescriptionGenerator.dll and b/docs/_template/description-generator/plugins/DocFX.Plugin.DescriptionGenerator.dll differ diff --git a/docs/_template/light-dark-theme/partials/head.tmpl.partial b/docs/_template/light-dark-theme/partials/head.tmpl.partial index a25da58fc..c214e7548 100644 --- a/docs/_template/light-dark-theme/partials/head.tmpl.partial +++ b/docs/_template/light-dark-theme/partials/head.tmpl.partial @@ -5,9 +5,18 @@ {{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}} - + + {{#_description}}{{/_description}} + + + + + + - {{#_description}}{{/_description}} + + + @@ -18,10 +27,6 @@ - - - - {{#_noindex}}{{/_noindex}} {{#_enableSearch}}{{/_enableSearch}} {{#_enableNewTab}}{{/_enableNewTab}} diff --git a/docs/_template/light-dark-theme/partials/scripts.tmpl.partial b/docs/_template/light-dark-theme/partials/scripts.tmpl.partial index 1b048feb9..3142f8c54 100644 --- a/docs/_template/light-dark-theme/partials/scripts.tmpl.partial +++ b/docs/_template/light-dark-theme/partials/scripts.tmpl.partial @@ -3,8 +3,6 @@ - - \ No newline at end of file diff --git a/docs/_template/light-dark-theme/styles/master.css b/docs/_template/light-dark-theme/styles/master.css index aa4b71ac6..cab54ac24 100644 --- a/docs/_template/light-dark-theme/styles/master.css +++ b/docs/_template/light-dark-theme/styles/master.css @@ -6,7 +6,6 @@ body { font-display: optional; height: 100%; font-size: 15px; - scroll-behavior: smooth; } code{ @@ -92,6 +91,10 @@ article.content h6{ line-height: 140%; } +.sideaffix > div.contribution { + margin-bottom: 0; +} + header .navbar { border-width: 0 0 0px; border-radius: 0; diff --git a/docs/_template/light-dark-theme/styles/plugin-featherlight.js b/docs/_template/light-dark-theme/styles/plugin-featherlight.js deleted file mode 100644 index 2fd056fa0..000000000 --- a/docs/_template/light-dark-theme/styles/plugin-featherlight.js +++ /dev/null @@ -1,37 +0,0 @@ -// MIT License - -// Copyright (c) 2017 Roel Fauconnier - -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -$(document).ready(function() { - //find all images, but not the logo, and add the lightbox - $('img').not('#logo').each(function(){ - var $img = $(this); - var filename = $img.attr('src') - //add cursor - $img.css('cursor','zoom-in'); - $img.css('cursor','-moz-zoom-in'); - $img.css('cursor','-webkit-zoom-in'); - - //add featherlight - $img.attr('alt', filename); - $img.featherlight(filename); - }); -}); \ No newline at end of file diff --git a/docs/docfx.json b/docs/docfx.json index 5ddd3f84e..17cf72388 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -35,7 +35,8 @@ "**/images/**", "**/samples/**", "langwordMapping.yml", - "marketing/logo/SVG/**.svg", + "marketing/logo/**.svg", + "marketing/logo/**.png", "favicon.ico" ] }], @@ -50,7 +51,7 @@ "overwrite": "_overwrites/**/**.md", "globalMetadata": { "_appTitle": "Discord.Net Documentation", - "_appFooter": "Discord.Net (c) 2015-2019 2.0.1", + "_appFooter": "Discord.Net (c) 2015-2019 2.1.1", "_enableSearch": true, "_appLogoPath": "marketing/logo/SVG/Logomark Purple.svg", "_appFaviconPath": "favicon.ico" diff --git a/docs/guides/getting_started/first-bot.md b/docs/guides/getting_started/first-bot.md index eb140cd75..bdae80c7f 100644 --- a/docs/guides/getting_started/first-bot.md +++ b/docs/guides/getting_started/first-bot.md @@ -146,23 +146,6 @@ method with the application's "token." > Pay attention to what you are copying from the developer portal! > A token is not the same as the application's "client secret." -> [!IMPORTANT] -> Your bot's token can be used to gain total access to your bot, so -> **do not** share this token with anyone else! You should store this -> token in an external source if you plan on distributing -> the source code for your bot. -> -> In the following example, we retrieve the token from the environment -> variable `DiscordToken`. Please note that this is *not* designed to -> be used in a production environment, as the secrets are stored in -> plain-text. -> -> For information on how to set an environment variable, please see -> instructions below, -> -> * Windows: [How to Create Environment Variables Shortcut in Windows](https://www.tenforums.com/tutorials/121742-create-environment-variables-shortcut-windows.html) -> * Linux: [How To Read and Set Environmental and Shell Variables on a Linux VPS](https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps) -> * macOS: [How do I set environment variables on OS X?](https://apple.stackexchange.com/questions/106778/how-do-i-set-environment-variables-on-os-x) We may now invoke the client's [StartAsync] method, which will start connection/reconnection logic. It is important to note that @@ -175,6 +158,22 @@ Finally, we will want to block the async main method from returning when running the application. To do this, we can await an infinite delay or any other blocking method, such as reading from the console. +> [!IMPORTANT] +> Your bot's token can be used to gain total access to your bot, so +> **do not** share this token with anyone else! You should store this +> token in an external source if you plan on distributing +> the source code for your bot. +> +> In the following example, we retrieve the token from a pre-defined +> variable, which is **NOT** secure, especially if you plan on +> distributing the application in any shape or form. +> +> We recommend alternative storage such as +> [Environment Variables], an external configuration file, or a +> secrets manager for safe-handling of secrets. +> +> [Environment Variables]: https://en.wikipedia.org/wiki/Environment_variable + The following lines can now be added: [!code-csharp[Create client](samples/first-bot/client.cs)] diff --git a/docs/guides/getting_started/installing.md b/docs/guides/getting_started/installing.md index f34032cb2..61e3bb6ec 100644 --- a/docs/guides/getting_started/installing.md +++ b/docs/guides/getting_started/installing.md @@ -78,7 +78,7 @@ published to our [MyGet feed]. See ### [Using dotnet CLI](#tab/dotnet-cli) -1. Launch your terminal +1. Launch a terminal of your choice 2. Navigate to where your `*.csproj` is located 3. Enter `dotnet add package Discord.Net` @@ -90,7 +90,7 @@ In order to compile Discord.Net, you will need the following: ### Using Visual Studio -* [Visual Studio 2017](https://www.visualstudio.com/) +* [Visual Studio 2019](https://visualstudio.microsoft.com/) * [.NET Core SDK] The .NET Core and Docker workload is required during Visual Studio @@ -109,7 +109,7 @@ When running any Discord.Net-powered bot on an older operating system you may encounter a @System.PlatformNotSupportedException upon connecting. -You may resolve this by either targeting .NET Core 2.1 or later, or +You may resolve this by either targeting .NET Core 2.1 or higher, or by installing one or more custom packages as listed below. #### [Targeting .NET Core 2.1](#tab/core2-1) @@ -141,4 +141,4 @@ over the default ones. *** -[.NET Core SDK]: https://www.microsoft.com/net/download/ \ No newline at end of file +[.NET Core SDK]: https://dotnet.microsoft.com/download \ No newline at end of file diff --git a/docs/guides/getting_started/nightlies.md b/docs/guides/getting_started/nightlies.md index d3844be1c..2b9fde87b 100644 --- a/docs/guides/getting_started/nightlies.md +++ b/docs/guides/getting_started/nightlies.md @@ -53,7 +53,7 @@ adding the feed to your package source. ### [Using dotnet CLI](#tab/cli) -1. Launch your terminal +1. Launch a terminal of your choice 2. Navigate to where your `*.csproj` is located 3. Type `dotnet add package Discord.Net --source https://www.myget.org/F/discord-net/api/v3/index.json` diff --git a/docs/guides/getting_started/samples/first-bot/client.cs b/docs/guides/getting_started/samples/first-bot/client.cs index 0e43bffb2..25be9f807 100644 --- a/docs/guides/getting_started/samples/first-bot/client.cs +++ b/docs/guides/getting_started/samples/first-bot/client.cs @@ -2,22 +2,22 @@ private DiscordSocketClient _client; public async Task MainAsync() { - _client = new DiscordSocketClient(); + _client = new DiscordSocketClient(); - _client.Log += Log; - - // You can assign your bot token to a string, and pass that in to connect. - // This however is insecure, particularly if you plan to have your code hosted in a repository. + _client.Log += Log; + + // You can assign your bot token to a string, and pass that in to connect. + // This is, however, insecure, particularly if you plan to have your code hosted in a public repository. var token = "token"; - - // Some alternative options would be to keep your token in an Environment Variable or a standalone file. + + // Some alternative options would be to keep your token in an Environment Variable or a standalone file. // var token = Environment.GetEnvironmentVariable("NameOfYourEnvironmentVariable"); // var token = File.ReadAllText("token.txt"); // var token = JsonConvert.DeserializeObject(File.ReadAllText("config.json")).Token; - await _client.LoginAsync(TokenType.Bot, token); - await _client.StartAsync(); + await _client.LoginAsync(TokenType.Bot, token); + await _client.StartAsync(); - // Block this task until the program is closed. - await Task.Delay(-1); -} + // Block this task until the program is closed. + await Task.Delay(-1); +} \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 79899e068..34350df70 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,7 +5,13 @@ title: Home # Discord.Net Documentation -