This change is because how our repo and project namespace uses .Net instead of .NET. For consistency sake, we should refer to the project as Discord.Net.pull/988/head
@@ -1,6 +1,6 @@ | |||||
# Instructions for Building Documentation | # Instructions for Building Documentation | ||||
The documentation for the Discord.NET library uses [DocFX][docfx-main]. [Instructions for installing this tool can be found here.][docfx-installing] | |||||
The documentation for the Discord.Net library uses [DocFX][docfx-main]. [Instructions for installing this tool can be found here.][docfx-installing] | |||||
1. Navigate to the root of the repository. | 1. Navigate to the root of the repository. | ||||
2. (Optional) If you intend to target a specific version, ensure that you | 2. (Optional) If you intend to target a specific version, ensure that you | ||||
@@ -14,7 +14,7 @@ title: Questions about Basic Operations | |||||
> | > | ||||
> Please refer to [this post] for more details. | > Please refer to [this post] for more details. | ||||
In Discord.NET, the idea of polymorphism is used throughout. You may | |||||
In Discord.Net, the idea of polymorphism is used throughout. You may | |||||
need to cast the object as a certain type before you can perform any | need to cast the object as a certain type before you can perform any | ||||
action. | action. | ||||
@@ -35,7 +35,7 @@ A good and safe casting example: | |||||
Any implementation of [IMessageChannel] has a [SendMessageAsync] | Any implementation of [IMessageChannel] has a [SendMessageAsync] | ||||
method. You can get the channel via [GetChannel] under the client. | method. You can get the channel via [GetChannel] under the client. | ||||
Remember, when using Discord.NET, polymorphism is a common recurring | |||||
Remember, when using Discord.Net, polymorphism is a common recurring | |||||
theme. This means an object may take in many shapes or form, which | theme. This means an object may take in many shapes or form, which | ||||
means casting is your friend. You should attempt to cast the channel | means casting is your friend. You should attempt to cast the channel | ||||
as an [IMessageChannel] or any other entity that implements it to be | as an [IMessageChannel] or any other entity that implements it to be | ||||
@@ -68,7 +68,7 @@ as in field values. With that in mind, links can be added with | |||||
## How do I add reactions to a message? | ## How do I add reactions to a message? | ||||
Any entities that implement [IUserMessage] has an [AddReactionAsync] | |||||
Any entity that implements [IUserMessage] has an [AddReactionAsync] | |||||
method. This method expects an [IEmote] as a parameter. | method. This method expects an [IEmote] as a parameter. | ||||
In Discord.Net, an Emote represents a server custom emote, while an | In Discord.Net, an Emote represents a server custom emote, while an | ||||
Emoji is a Unicode emoji (standard emoji). Both [Emoji] and [Emote] | Emoji is a Unicode emoji (standard emoji). Both [Emoji] and [Emote] | ||||
@@ -80,7 +80,7 @@ implement [IEmote] and are valid options. | |||||
## What is a "preemptive rate limit?" | ## What is a "preemptive rate limit?" | ||||
A preemptive rate limit is Discord.NET's way of telling you to slow | |||||
A preemptive rate limit is Discord.Net's way of telling you to slow | |||||
down before you get hit by the real rate limit. Hitting a real rate | down before you get hit by the real rate limit. Hitting a real rate | ||||
limit might prevent your entire client from sending any requests for | limit might prevent your entire client from sending any requests for | ||||
a period of time. This is calculated based on the HTTP header | a period of time. This is calculated based on the HTTP header | ||||
@@ -46,7 +46,7 @@ the last parameter. | |||||
## What is a service? Why does my module not hold any data after execution? | ## What is a service? Why does my module not hold any data after execution? | ||||
In Discord.NET, modules are created similarly to ASP.NET, meaning | |||||
In Discord.Net, modules are created similarly to ASP.NET, meaning | |||||
that they have a transient nature. This means that they are spawned | that they have a transient nature. This means that they are spawned | ||||
every time when a request is received, and are killed from memory | every time when a request is received, and are killed from memory | ||||
when the execution finishes. This is why you cannot store persistent | when the execution finishes. This is why you cannot store persistent | ||||
@@ -57,7 +57,7 @@ persist throughout execution. Think of it like a chest that holds | |||||
whatever you throw at it that won't be affected by anything unless | whatever you throw at it that won't be affected by anything unless | ||||
you want it to. Note that you should also learn Microsoft's | you want it to. Note that you should also learn Microsoft's | ||||
implementation of [Dependency Injection] \([video]) before proceeding, as well | implementation of [Dependency Injection] \([video]) before proceeding, as well | ||||
as how it works in [Discord.NET](xref:Guides.Commands.Intro#usage-in-modules). | |||||
as how it works in [Discord.Net](xref:Guides.Commands.Intro#usage-in-modules). | |||||
A brief example of service and dependency injection can be seen below. | A brief example of service and dependency injection can be seen below. | ||||
@@ -66,7 +66,7 @@ A brief example of service and dependency injection can be seen below. | |||||
[Dependency Injection]: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection | [Dependency Injection]: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection | ||||
[video]: https://www.youtube.com/watch?v=QtDTfn8YxXg | [video]: https://www.youtube.com/watch?v=QtDTfn8YxXg | ||||
## I have a long-running Task in my command, and Discord.NET keeps saying that a `MessageReceived` handler is blocking the gateway. What gives? | |||||
## I have a long-running Task in my command, and Discord.Net keeps saying that a `MessageReceived` handler is blocking the gateway. What gives? | |||||
By default, all commands are executed on the same thread as the | By default, all commands are executed on the same thread as the | ||||
gateway task, which is responsible for keeping the connection from | gateway task, which is responsible for keeping the connection from | ||||
@@ -112,7 +112,7 @@ the [DefaultRunMode] flag under `CommandServiceConfig`. | |||||
[CommandAttribute]: xref:Discord.Commands.CommandAttribute | [CommandAttribute]: xref:Discord.Commands.CommandAttribute | ||||
[DefaultRunMode]: xref:Discord.Commands.CommandServiceConfig.DefaultRunMode | [DefaultRunMode]: xref:Discord.Commands.CommandServiceConfig.DefaultRunMode | ||||
## How does `RunMode.Async` work, and why is Discord.NET *not* using it by default? | |||||
## How does `RunMode.Async` work, and why is Discord.Net *not* using it by default? | |||||
`RunMode.Async` works by spawning a new `Task` with an unawaited | `RunMode.Async` works by spawning a new `Task` with an unawaited | ||||
[Task.Run], essentially making `ExecuteAsyncInternalAsync`, the task | [Task.Run], essentially making `ExecuteAsyncInternalAsync`, the task | ||||
@@ -131,7 +131,7 @@ The following are the known caveats with `RunMode.Async`, | |||||
However, there are ways to remedy some of these. | However, there are ways to remedy some of these. | ||||
For #3, in Discord.NET 2.0, the library introduces a new event called | |||||
For #3, in Discord.Net 2.0, the library introduces a new event called | |||||
[CommandExecuted], which is raised whenever the command is | [CommandExecuted], which is raised whenever the command is | ||||
**successfully executed**. This event will be raised regardless of | **successfully executed**. This event will be raised regardless of | ||||
the `RunMode` type and will return the appropriate execution result. | the `RunMode` type and will return the appropriate execution result. | ||||
@@ -17,7 +17,7 @@ Visit the repo's [release tag] to see the latest public pre-release. | |||||
[release tag]: https://github.com/RogueException/Discord.Net/releases | [release tag]: https://github.com/RogueException/Discord.Net/releases | ||||
## I came from an earlier version of Discord.NET 1.0, and DependencyMap doesn't seem to exist anymore in the later revision? What happened to it? | |||||
## I came from an earlier version of Discord.Net 1.0, and DependencyMap doesn't seem to exist anymore in the later revision? What happened to it? | |||||
The `DependencyMap` has been replaced with Microsoft's | The `DependencyMap` has been replaced with Microsoft's | ||||
[DependencyInjection] Abstractions. An example usage can be seen | [DependencyInjection] Abstractions. An example usage can be seen | ||||
@@ -10,7 +10,7 @@ title: Post-command Execution Handling | |||||
When developing a command system or modules, you may want to consider | When developing a command system or modules, you may want to consider | ||||
building a post-execution handling system so you can have a finer | building a post-execution handling system so you can have a finer | ||||
control over commands. Discord.NET offers several different | |||||
control over commands. Discord.Net offers several different | |||||
post-execution workflow for you to work with. | post-execution workflow for you to work with. | ||||
If you recall, in the [Command Guide], we've shown the following | If you recall, in the [Command Guide], we've shown the following | ||||
@@ -39,7 +39,7 @@ may not always achieve the desired effect. | |||||
## CommandExecuted Event | ## CommandExecuted Event | ||||
Enter [CommandExecuted], an event that was introduced in | Enter [CommandExecuted], an event that was introduced in | ||||
Discord.NET 2.0. This event is raised when the command is | |||||
Discord.Net 2.0. This event is raised when the command is | |||||
sucessfully executed **without any runtime exceptions** (more on this | sucessfully executed **without any runtime exceptions** (more on this | ||||
later). This means this event can be used to streamline your | later). This means this event can be used to streamline your | ||||
post-execution design, and the best thing about this event is that it | post-execution design, and the best thing about this event is that it | ||||
@@ -3,7 +3,7 @@ uid: Guides.Concepts.Entities | |||||
title: Entities | title: Entities | ||||
--- | --- | ||||
# Entities in Discord.NET | |||||
# Entities in Discord.Net | |||||
> [!NOTE] | > [!NOTE] | ||||
> This article is written with the Socket variants of entities in mind, | > This article is written with the Socket variants of entities in mind, | ||||
@@ -3,7 +3,7 @@ uid: Guides.Concepts.Events | |||||
title: Working with Events | title: Working with Events | ||||
--- | --- | ||||
# Events in Discord.NET | |||||
# Events in Discord.Net | |||||
Events in Discord.Net are consumed in a similar manner to the standard | Events in Discord.Net are consumed in a similar manner to the standard | ||||
convention, with the exception that every event must be of the type | convention, with the exception that every event must be of the type | ||||
@@ -3,7 +3,7 @@ uid: Guides.Concepts.Logging | |||||
title: Logging | title: Logging | ||||
--- | --- | ||||
# Logging in Discord.NET | |||||
# Logging in Discord.Net | |||||
Discord.Net's clients provide a log event that all messages will be | Discord.Net's clients provide a log event that all messages will be | ||||
dispatched over. | dispatched over. | ||||
@@ -1,7 +1,7 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||
<!-- | <!-- | ||||
The following may differ depending on the latest version of | The following may differ depending on the latest version of | ||||
.NET Core Framework or Discord.NET. | |||||
.NET Core Framework or Discord.Net. | |||||
--> | --> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
<OutputType>Exe</OutputType> | <OutputType>Exe</OutputType> | ||||
@@ -1,6 +1,6 @@ | |||||
--- | --- | ||||
uid: Guides.Introduction | uid: Guides.Introduction | ||||
title: Introduction to Discord.NET | |||||
title: Introduction to Discord.Net | |||||
--- | --- | ||||
# Introduction | # Introduction | ||||
@@ -5,9 +5,9 @@ title: Home | |||||
# Discord.Net Documentation | # Discord.Net Documentation | ||||
## What is Discord.NET? | |||||
## What is Discord.Net? | |||||
Discord.NET is an asynchronous, multi-platform .NET Library used to | |||||
Discord.Net is an asynchronous, multi-platform .NET Library used to | |||||
interface with the [Discord API](https://discordapp.com/). | interface with the [Discord API](https://discordapp.com/). | ||||
## Where to begin? | ## Where to begin? | ||||