Browse Source

Clean up commands documentation; index

tags/1.0-rc
Christopher F 8 years ago
parent
commit
5b394d23c1
4 changed files with 14 additions and 13 deletions
  1. +1
    -1
      docs/.gitignore
  2. +1
    -1
      docs/api/.manifest
  3. +7
    -7
      docs/guides/commands.md
  4. +5
    -4
      docs/index.md

+ 1
- 1
docs/.gitignore View File

@@ -7,4 +7,4 @@
/**/packages/ /**/packages/
/**/bin/ /**/bin/
/**/obj/ /**/obj/
_site
_site

+ 1
- 1
docs/api/.manifest
File diff suppressed because it is too large
View File


+ 7
- 7
docs/guides/commands.md View File

@@ -16,21 +16,21 @@ Modules serve as a host for commands you create.


To create a module, create a class that you will place commands in. Flag this class with the `[Module]` attribute. You may optionally pass in a string to the `Module` attribute to set a prefix for all of the commands inside the module. To create a module, create a class that you will place commands in. Flag this class with the `[Module]` attribute. You may optionally pass in a string to the `Module` attribute to set a prefix for all of the commands inside the module.


### Example:
### Example Module


[!code-csharp[Modules](samples/module.cs)] [!code-csharp[Modules](samples/module.cs)]


### Loading Modules Automatically
#### Loading Modules Automatically


The Command Service can automatically discover all classes in an Assembly that are flagged with the `Module` attribute, and load them. The Command Service can automatically discover all classes in an Assembly that are flagged with the `Module` attribute, and load them.


To have a module opt-out of auto-loading, pass `autoload: false` in the Module attribute. To have a module opt-out of auto-loading, pass `autoload: false` in the Module attribute.


Invoke [CommandService.LoadAssembly](Discord.Commands.CommandService#Discord_Commands_CommandService_LoadAssembly) to discover modules and install them.
Invoke [CommandService.LoadAssembly](xref:Discord.Commands.CommandService#Discord_Commands_CommandService_LoadAssembly) to discover modules and install them.


### Loading Modules Manually
#### Loading Modules Manually


To manually load a module, invoke [CommandService.Load](Discord.Commands.CommandService#Discord_Commands_CommandService_Load), and pass in an instance of your module.
To manually load a module, invoke [CommandService.Load](xref:Discord.Commands.CommandService#Discord_Commands_CommandService_Load), and pass in an instance of your module.


### Module Constructors ### Module Constructors


@@ -42,7 +42,7 @@ Alternatively, you can use an @Discord.Commands.IDependencyMap, as shown below.


The Commands Service includes a very basic implementation of Dependency Injection that allows you to have completely custom constructors, within certain limitations. The Commands Service includes a very basic implementation of Dependency Injection that allows you to have completely custom constructors, within certain limitations.


## Setup
### Setup


First, you need to create an @Discord.Commands.IDependencyMap . The library includes @Discord.Commands.DependencyMap to help with this, however you may create your own IDependencyMap if you wish. First, you need to create an @Discord.Commands.IDependencyMap . The library includes @Discord.Commands.DependencyMap to help with this, however you may create your own IDependencyMap if you wish.


@@ -52,7 +52,7 @@ Finally, pass the map into the `LoadAssembly` method. Your modules will automati


[!code-csharp[DependencyMap Setup](samples/dependency_map_setup.cs)] [!code-csharp[DependencyMap Setup](samples/dependency_map_setup.cs)]


## Usage in Modules
### Usage in Modules


In the constructor of your module, any parameters will be filled in by the @Discord.Commands.IDependencyMap you pass into `LoadAssembly`. In the constructor of your module, any parameters will be filled in by the @Discord.Commands.IDependencyMap you pass into `LoadAssembly`.




+ 5
- 4
docs/index.md View File

@@ -1,5 +1,6 @@


# This is the **HOMEPAGE**.
Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
## Quick Start Notes:
1. Add images to *images* folder if the file is referencing an image.
# Discord.Net Documentation

Refer to [Guides](guides/) for tutorials on using Discord.Net, or the [API documentation](api/) to review individual objects in the library.

**Todo:** Put something meaningful here.

Loading…
Cancel
Save