You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

intro.md 8.4 KiB

Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
Improve library documentation (#826) * Improve the Command Service documentation The following changes have been added to this PR: • Fix minor grammatical errors. • Capitalize terms such as Commands, Modules and such, as the context is specific to the lib. • Wrap methods and properties in code blocks. The docs page currently has several issues that remains to be fixed. 1. ```md >[!WARNING] >This article is out of date and has not been rewritten yet. Information is not guaranteed to be accurate. ``` The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib. 2. >“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.” The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence. 3. >“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” Any mention of @System.IServiceProvider is currently broken on the docs. 4. >“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).” Clarification on the part after "although?" 5. >“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.” Where is this `LoadAssembly` method? 6. ```md >[!NOTE] >Preconditions can be applied to Modules, Groups, or Commands. ``` The docs should mention `ParameterPreconditionAttribute`'s existence. * Update line breaks to comply with docs standard * Change "you should..." to "instead, ..." * Trim trailing spaces * Change "inherits" to "inherit" * Fix Context warning note and add ReplyAsync xref * Fix broken xrefs * Fix [Command Service] xref * Fix consistency between TypeReaders and Preconditions returns * Add missing semi-colons in ServiceProvider sample * Change CommandContext to SocketCommandContext & change variable naming * Cleanup TypeReader section * Wrap [DontInject] in code block * Fix commands docs linking in intro * Improve Getting Started - Installation - Fix character misalignment to comply with docs standard. - Fix image numbering issues by moving the tooltips above some of the steps. - Add codeblocks to search terms like `Discord.Net`. - Remove broken `addons` reference. - Specify `.NET 4.6.1` as `.NET Framework 4.6.1`. - Minor cross-reference cleanup. * Fix Getting Started - Intro - Minor grammartical fixes. - Wrap mentions of the methods, properties, and events in code block. - Replace `Discord.Net` to `Discord.NET`. - Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`. - Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead. - Change code block of `Pong!` to quotation mark instead. * Fix cross references in Sending Voice * Mention parameter precondition attribute * Change `Discord.NET` to `Discord.Net` for consistency * Wrap project names in code blocks & minor fixes in Terminology * Change `add-ons` to `addons` for consistency * Fix cross references in Logging * Fix minor grammatical issues in "Working with Events" * Missed a tilda * Remove out-of-date warning in Commands * Minor grammatical fixes for Entities * Fix broken xref in Logging * Adjust service collection sample ...according to https://github.com/RogueException/Discord.Net/pull/826/files/f89aecb7bfa8fe82a541d3bba44d0e37c125d235#r141530227 * Update Command Handler sample - Update Main for C# 7.1. - Inject CommandService and DiscordSocketClient into the service collection. - Add Async suffix to asynchronous methods. * Minor grammatical fixes in Events * Revert 2 incorrect grammar corrections * Revert async Main sample * Add hardcode token notice in sample * Fix missing method for Command Handler * Modify module samples to use SocketCommandContext instead * Emphasize CommandContext and SocketCommandContext * Fix formatting for module sample * Add SocketCommandContext for Groups sample * Remove comma * Fix DepMap sample formatting * Replace [DontInject] with DontInjectAttribute with cross reference * Remove connection logic note There is no reason that this note should still be here since Ready event exists. * Add a new warning message informing the users the existence of CommandService * Make command handler private excellent change
7 years ago
8 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. ---
  2. title: Getting Started
  3. ---
  4. # Making a Ping-Pong bot
  5. One of the first steps to getting started with the Discord API is to
  6. write a basic ping-pong bot. We will expand on this to create more
  7. diverse commands later, but for now, it is a good starting point.
  8. ## Creating a Discord Bot
  9. Before you can begin writing your bot, it is necessary to create a bot
  10. account on Discord.
  11. 1. Visit the [Discord Applications Portal].
  12. 2. Create a New Application.
  13. 3. Give the application a name (this will be the bot's initial
  14. username).
  15. 4. Create the Application.
  16. ![Step 4](images/intro-create-app.png)
  17. 5. In the application review page, click **Create a Bot User**.
  18. ![Step 5](images/intro-create-bot.png)
  19. 6. Confirm the popup.
  20. 7. If this bot will be public, check "Public Bot." **Do not tick any
  21. other options!**
  22. [Discord Applications Portal]: https://discordapp.com/developers/applications/me
  23. ## Adding your bot to a server
  24. Bots **cannot** use invite links, they must be explicitly invited
  25. through the OAuth2 flow.
  26. 1. Open your bot's application on the [Discord Applications Portal].
  27. 2. Retrieve the app's **Client ID**.
  28. ![Step 2](images/intro-client-id.png)
  29. 3. Create an OAuth2 authorization URL
  30. `https://discordapp.com/oauth2/authorize?client_id=<CLIENT ID>&scope=bot`
  31. 4. Open the authorization URL in your browser.
  32. 5. Select a server.
  33. 6. Click on authorize.
  34. >[!NOTE]
  35. Only servers where you have the `MANAGE_SERVER` permission will be
  36. present in this list.
  37. ![Step 6](images/intro-add-bot.png)
  38. ## Connecting to Discord
  39. If you have not already created a project and installed Discord.Net,
  40. do that now. (see the [Installing](installing.md) section)
  41. ### Async
  42. Discord.Net uses .NET's [Task-based Asynchronous Pattern (TAP)]
  43. extensively - nearly every operation is asynchronous.
  44. It is highly recommended that these operations are awaited in a
  45. properly established async context whenever possible. Establishing an
  46. async context can be problematic, but not hard.
  47. To do so, we will be creating an async main in your console
  48. application, and rewriting the static main method to invoke the new
  49. async main.
  50. [!code-csharp[Async Context](samples/intro/async-context.cs)]
  51. As a result of this, your program will now start and immediately
  52. jump into an async context. This will allow us to create a connection
  53. to Discord later on without needing to worry about setting up the
  54. correct async implementation.
  55. >[!TIP]
  56. If your application throws any exceptions within an async context,
  57. they will be thrown all the way back up to the first non-async method;
  58. since our first non-async method is the program's `Main` method, this
  59. means that **all** unhandled exceptions will be thrown up there, which
  60. will crash your application. Discord.Net will prevent exceptions in
  61. event handlers from crashing your program, but any exceptions in your
  62. async main **will** cause the application to crash.
  63. [Task-based Asynchronous Pattern (TAP)]: https://docs.microsoft.com/en-us/dotnet/articles/csharp/async
  64. ### Creating a logging method
  65. Before we create and configure a Discord client, we will add a method
  66. to handle Discord.Net's log events.
  67. To allow agnostic support of as many log providers as possible, we
  68. log information through a `Log` event with a proprietary `LogMessage`
  69. parameter. See the [API Documentation] for this event.
  70. If you are using your own logging framework, this is where you would
  71. invoke it. For the sake of simplicity, we will only be logging to
  72. the Console.
  73. [!code-csharp[Async Context](samples/intro/logging.cs)]
  74. [API Documentation]: xref:Discord.Rest.BaseDiscordClient#Discord_Rest_BaseDiscordClient_Log
  75. ### Creating a Discord Client
  76. Finally, we can create a connection to Discord. Since we are writing
  77. a bot, we will be using a [DiscordSocketClient] along with socket
  78. entities. See the [terminology](terminology.md) if you're unsure of
  79. the differences.
  80. To do so, create an instance of [DiscordSocketClient] in your async
  81. main, passing in a configuration object only if necessary. For most
  82. users, the default will work fine.
  83. Before connecting, we should hook the client's `Log` event to the
  84. log handler that was just created. Events in Discord.Net work
  85. similarly to other events in C#, so hook this event the way that
  86. you typically would.
  87. Next, you will need to "login to Discord" with the `LoginAsync`
  88. method.
  89. You may create a variable to hold your bot's token (this can be found
  90. on your bot's application page on the [Discord Applications Portal]).
  91. ![Token](images/intro-token.png)
  92. >[!IMPORTANT]
  93. Your bot's token can be used to gain total access to your bot, so
  94. **do __NOT__ share this token with anyone else!** It may behoove you
  95. to store this token in an external file if you plan on distributing
  96. the source code for your bot.
  97. We may now invoke the client's `StartAsync` method, which will
  98. start connection/reconnection logic. It is important to note that
  99. **this method returns as soon as connection logic has been started!**
  100. Any methods that rely on the client's state should go in an event
  101. handler.
  102. Finally, we will want to block the async main method from returning
  103. until after the application is exited. To do this, we can await an
  104. infinite delay or any other blocking method, such as reading from
  105. the console.
  106. The following lines can now be added:
  107. [!code-csharp[Create client](samples/intro/client.cs)]
  108. At this point, feel free to start your program and see your bot come
  109. online in Discord.
  110. >[!TIP]
  111. Encountering a `PlatformNotSupportedException` when starting your bot?
  112. This means that you are targeting a platform where .NET's default
  113. WebSocket client is not supported. Refer to the [installation guide]
  114. for how to fix this.
  115. [DiscordSocketClient]: xref:Discord.WebSocket.DiscordSocketClient
  116. [installation guide]: installing.md#installing-on-net-standard-11
  117. ### Handling a 'ping'
  118. >[!WARNING]
  119. Please note that this is *not* a proper way to create a command.
  120. Use the `CommandService` provided by the library instead, as explained
  121. in the [Command Guide] section.
  122. Now that we have learned how to open a connection to Discord, we can
  123. begin handling messages that users are sending.
  124. To start out, our bot will listen for any message where the content
  125. is equal to `!ping` and respond back with "Pong!".
  126. Since we want to listen for new messages, the event to hook into
  127. is [MessageReceived].
  128. In your program, add a method that matches the signature of the
  129. `MessageReceived` event - it must be a method (`Func`) that returns
  130. the type `Task` and takes a single parameter, a [SocketMessage]. Also,
  131. since we will be sending data to Discord in this method, we will flag
  132. it as `async`.
  133. In this method, we will add an `if` block to determine if the message
  134. content fits the rules of our scenario - recall that it must be equal
  135. to `!ping`.
  136. Inside the branch of this condition, we will want to send a message
  137. back to the channel from which the message comes from - "Pong!". To
  138. find the channel, look for the `Channel` property on the message
  139. parameter.
  140. Next, we will want to send a message to this channel. Since the
  141. channel object is of type [SocketMessageChannel], we can invoke the
  142. `SendMessageAsync` instance method. For the message content, send back
  143. a string containing "Pong!".
  144. You should have now added the following lines:
  145. [!code-csharp[Message](samples/intro/message.cs)]
  146. Now your first bot is complete. You may continue to add on to this
  147. if you desire, but for any bots that will be carrying out multiple
  148. commands, it is strongly recommended to use the command framework as
  149. shown below.
  150. For your reference, you may view the [completed program].
  151. [MessageReceived]: xref:Discord.WebSocket.BaseSocketClient#Discord_WebSocket_BaseSocketClient_MessageReceived
  152. [SocketMessage]: xref:Discord.WebSocket.SocketMessage
  153. [SocketMessageChannel]: xref:Discord.WebSocket.ISocketMessageChannel
  154. [completed program]: samples/intro/complete.cs
  155. [Command Guide]: ../commands/commands.md
  156. # Building a bot with commands
  157. This section will show you how to write a program that is ready for
  158. [Commands](../commands/commands.md). Note that we will not be
  159. explaining _how_ to write Commands or Services, it will only be
  160. covering the general structure.
  161. For reference, view an [annotated example] of this structure.
  162. [annotated example]: samples/intro/structure.cs
  163. It is important to know that the recommended design pattern of bots
  164. should be to separate the program (initialization and command handler),
  165. the modules (handle commands), and the services (persistent storage,
  166. pure functions, data manipulation).
  167. **todo:** diagram of bot structure