| @@ -6,7 +6,7 @@ remarks: *content | |||||
| The attribute can be applied to a public settable property inside a | The attribute can be applied to a public settable property inside a | ||||
| @Discord.Commands.ModuleBase based class. By applying this attribute, | @Discord.Commands.ModuleBase based class. By applying this attribute, | ||||
| the marked property will not be automatically injected of the | the marked property will not be automatically injected of the | ||||
| dependency. See [Dependency Injection](../../guides/commands/commands.md#dependency-injection) | |||||
| dependency. See [Dependency Injection](xref:Guides.Commands.Intro#dependency-injection) | |||||
| to learn more. | to learn more. | ||||
| --- | --- | ||||
| @@ -1,13 +1,16 @@ | |||||
| --- | |||||
| uid: API.Docs | |||||
| --- | |||||
| # API Documentation | # API Documentation | ||||
| This is where you will find documentation for all members and objects in Discord.Net | |||||
| This is where you will find documentation for all members and objects in Discord.Net. | |||||
| __Commonly Used Entities__ | |||||
| # Commonly Used Entities | |||||
| * @Discord.WebSocket | |||||
| * @Discord.WebSocket.DiscordSocketClient | |||||
| * @Discord.WebSocket.SocketGuildChannel | |||||
| * @Discord.WebSocket.SocketGuildUser | |||||
| * @Discord.WebSocket.SocketMessage | |||||
| * @Discord.WebSocket.SocketRole | |||||
| * @Discord.WebSocket | |||||
| * @Discord.WebSocket.DiscordSocketClient | |||||
| * @Discord.WebSocket.SocketGuildChannel | |||||
| * @Discord.WebSocket.SocketGuildUser | |||||
| * @Discord.WebSocket.SocketMessage | |||||
| * @Discord.WebSocket.SocketRole | |||||
| @@ -1,3 +1,8 @@ | |||||
| --- | |||||
| uid: FAQ.Basics.BasicOp | |||||
| title: Questions about Basic Operations | |||||
| --- | |||||
| # Basic Operations Questions | # Basic Operations Questions | ||||
| ## How should I safely check a type? | ## How should I safely check a type? | ||||
| @@ -15,7 +20,7 @@ action. | |||||
| A good and safe casting example: | A good and safe casting example: | ||||
| [!code-csharp[Casting](samples/basics/cast.cs)] | |||||
| [!code-csharp[Casting](samples/cast.cs)] | |||||
| [InvalidCastException]: https://docs.microsoft.com/en-us/dotnet/api/system.invalidcastexception | [InvalidCastException]: https://docs.microsoft.com/en-us/dotnet/api/system.invalidcastexception | ||||
| [this post]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/types/how-to-safely-cast-by-using-as-and-is-operators | [this post]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/types/how-to-safely-cast-by-using-as-and-is-operators | ||||
| @@ -44,7 +49,7 @@ able to message. | |||||
| You may check the message channel type. Visit [Glossary] to see the | You may check the message channel type. Visit [Glossary] to see the | ||||
| various types of channels. | various types of channels. | ||||
| [Glossary]: Glossary.md#message-channels | |||||
| [Glossary]: xref:FAQ.Misc.Glossary#message-channels | |||||
| ## How can I get the guild from a message? | ## How can I get the guild from a message? | ||||
| @@ -69,7 +74,7 @@ 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] | ||||
| implement [IEmote] and are valid options. | implement [IEmote] and are valid options. | ||||
| [!code-csharp[Emoji](samples/basics/emoji.cs)] | |||||
| [!code-csharp[Emoji](samples/emoji.cs)] | |||||
| [AddReactionAsync]: xref:Discord.IUserMessage.AddReactionAsync* | [AddReactionAsync]: xref:Discord.IUserMessage.AddReactionAsync* | ||||
| @@ -1,3 +1,8 @@ | |||||
| --- | |||||
| uid: FAQ.Basics.ClientBasics | |||||
| title: Basic Questions about Client | |||||
| --- | |||||
| # Client Basics Questions | # Client Basics Questions | ||||
| ## My client keeps returning 401 upon logging in! | ## My client keeps returning 401 upon logging in! | ||||
| @@ -42,7 +47,7 @@ event is triggered, then you can proceed to do whatever you like. | |||||
| If you need to do anything with messages (e.g. checking Reactions, | If you need to do anything with messages (e.g. checking Reactions, | ||||
| checking the content of edited/deleted messages), you must set the | checking the content of edited/deleted messages), you must set the | ||||
| [MessageCacheSize] in your [DiscordSocketConfig] settings in order to | [MessageCacheSize] in your [DiscordSocketConfig] settings in order to | ||||
| use the cached message entity. Read more about it [here](../guides/concepts/events.md#cacheable). | |||||
| use the cached message entity. Read more about it [here](xref:Guides.Concepts.Events#cacheable). | |||||
| 1. Message Cache must be enabled. | 1. Message Cache must be enabled. | ||||
| 2. Hook the MessageUpdated event. This event provides a *before* and | 2. Hook the MessageUpdated event. This event provides a *before* and | ||||
| @@ -1,3 +1,8 @@ | |||||
| --- | |||||
| uid: FAQ.Basics.GetStarted | |||||
| title: Beginner Questions / How to Get Started | |||||
| --- | |||||
| # Basic Concepts / Getting Started | # Basic Concepts / Getting Started | ||||
| ## How do I add my bot to my server/guild? | ## How do I add my bot to my server/guild? | ||||
| @@ -1,3 +1,8 @@ | |||||
| --- | |||||
| uid: FAQ.Commands | |||||
| title: Questions about Commands | |||||
| --- | |||||
| # Command-related Questions | # Command-related Questions | ||||
| ## How can I restrict some of my commands so only certain users can execute them? | ## How can I restrict some of my commands so only certain users can execute them? | ||||
| @@ -35,7 +40,7 @@ recognized as a single object. Please note that if your method has | |||||
| multiple parameters, the remainder attribute can only be applied to | multiple parameters, the remainder attribute can only be applied to | ||||
| the last parameter. | the last parameter. | ||||
| [!code-csharp[Remainder](samples/commands/Remainder.cs)] | |||||
| [!code-csharp[Remainder](samples/Remainder.cs)] | |||||
| [RemainderAttribute]: xref:Discord.Commands.RemainderAttribute | [RemainderAttribute]: xref:Discord.Commands.RemainderAttribute | ||||
| @@ -52,11 +57,11 @@ 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](../guides/commands/commands.md#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. | ||||
| [!code-csharp[DI](samples/commands/DI.cs)] | |||||
| [!code-csharp[DI](samples/DI.cs)] | |||||
| [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 | ||||
| @@ -83,11 +88,11 @@ the [DefaultRunMode] flag under `CommandServiceConfig`. | |||||
| # [CommandAttribute](#tab/cmdattrib) | # [CommandAttribute](#tab/cmdattrib) | ||||
| [!code-csharp[Command Attribute](samples/commands/runmode-cmdattrib.cs)] | |||||
| [!code-csharp[Command Attribute](samples/runmode-cmdattrib.cs)] | |||||
| # [CommandServiceConfig](#tab/cmdconfig) | # [CommandServiceConfig](#tab/cmdconfig) | ||||
| [!code-csharp[Command Service Config](samples/commands/runmode-cmdconfig.cs)] | |||||
| [!code-csharp[Command Service Config](samples/runmode-cmdconfig.cs)] | |||||
| *** | *** | ||||
| @@ -1,3 +1,8 @@ | |||||
| --- | |||||
| uid: FAQ.Misc.Glossary | |||||
| title: Common Terminologies / Glossary | |||||
| --- | |||||
| # Glossary | # Glossary | ||||
| ## Common Types | ## Common Types | ||||
| @@ -1,3 +1,8 @@ | |||||
| --- | |||||
| uid: FAQ.Misc.Legacy | |||||
| title: Questions about Legacy Versions | |||||
| --- | |||||
| # Legacy Questions | # Legacy Questions | ||||
| ## X, Y, Z does not work! It doesn't return a valid value anymore. | ## X, Y, Z does not work! It doesn't return a valid value anymore. | ||||
| @@ -1,18 +1,18 @@ | |||||
| - name: Basic Concepts | - name: Basic Concepts | ||||
| items: | items: | ||||
| - name: Getting Started | - name: Getting Started | ||||
| href: getting-started.md | |||||
| topicUid: FAQ.Basics.GetStarted | |||||
| - name: Basic Operations | - name: Basic Operations | ||||
| href: basic-operations.md | |||||
| topicUid: FAQ.Basics.BasicOp | |||||
| - name: Client Basics | - name: Client Basics | ||||
| href: client-basics.md | |||||
| topicUid: FAQ.Basics.ClientBasics | |||||
| - name: Command | - name: Command | ||||
| items: | items: | ||||
| - name: Commands | - name: Commands | ||||
| href: commands.md | |||||
| topicUid: FAQ.Commands | |||||
| - name: Misc | - name: Misc | ||||
| items: | items: | ||||
| - name: Glossary | - name: Glossary | ||||
| href: glossary.md | |||||
| topicUid: FAQ.Misc.Glossary | |||||
| - name: Legacy or Upgrade | - name: Legacy or Upgrade | ||||
| href: legacy.md | |||||
| topicUid: FAQ.Misc.Legacy | |||||
| @@ -1,3 +1,8 @@ | |||||
| --- | |||||
| uid: Guides.Commands.Intro | |||||
| title: Introduction to the Command Service | |||||
| --- | |||||
| # The Command Service | # The Command Service | ||||
| [Discord.Commands](xref:Discord.Commands) provides an attribute-based | [Discord.Commands](xref:Discord.Commands) provides an attribute-based | ||||
| @@ -1,3 +1,8 @@ | |||||
| --- | |||||
| uid: Guides.Commands.PostExecution | |||||
| title: Post-command Execution Handling | |||||
| --- | |||||
| # Preface | # Preface | ||||
| When developing a command system or modules, you may want to consider | When developing a command system or modules, you may want to consider | ||||
| @@ -25,7 +30,7 @@ issue, working with `RunMode.Async`. | |||||
| If your command is marked with `RunMode.Async`, [ExecuteAsync] will | If your command is marked with `RunMode.Async`, [ExecuteAsync] will | ||||
| return a successful [ExecuteResult] instead of whatever results | return a successful [ExecuteResult] instead of whatever results | ||||
| the actual command may return. Because of the way `RunMode.Async` | the actual command may return. Because of the way `RunMode.Async` | ||||
| [works](../../faq/commands.md), handling within the command handler | |||||
| [works](xref:FAQ.Commands), handling within the command handler | |||||
| may not always achieve the desired effect. | may not always achieve the desired effect. | ||||
| ## CommandExecuted Event | ## CommandExecuted Event | ||||
| @@ -38,4 +43,4 @@ sucessfully executed** and is not prone to `RunMode.Async`'s | |||||
| [CommandExecuted]: xref:Discord.Commands.CommandService.CommandExecuted | [CommandExecuted]: xref:Discord.Commands.CommandService.CommandExecuted | ||||
| [ExecuteAsync]: xref:Discord.Commands.CommandService.ExecuteAsync* | [ExecuteAsync]: xref:Discord.Commands.CommandService.ExecuteAsync* | ||||
| [ExecuteResult]: xref:Discord.Commands.ExecuteResult | [ExecuteResult]: xref:Discord.Commands.ExecuteResult | ||||
| [Command Guide]: Commands.md | |||||
| [Command Guide]: xref:Guides.Commands.Intro | |||||
| @@ -1,21 +1,21 @@ | |||||
| --- | --- | ||||
| uid: Guides.Concepts.ManageConnections | |||||
| title: Managing Connections | title: Managing Connections | ||||
| --- | --- | ||||
| In Discord.Net, once a client has been started, it will automatically | In Discord.Net, once a client has been started, it will automatically | ||||
| maintain a connection to Discord's gateway, until it is manually | |||||
| maintain a connection to Discord's gateway until it is manually | |||||
| stopped. | stopped. | ||||
| ### Usage | ### Usage | ||||
| To start a connection, invoke the `StartAsync` method on a client that | To start a connection, invoke the `StartAsync` method on a client that | ||||
| supports a WebSocket connection. | |||||
| To end a connection, invoke the `StopAsync` method. This will | |||||
| gracefully close any open WebSocket or UdpSocket connections. | |||||
| supports a WebSocket connection; to end a connection, invoke the | |||||
| `StopAsync` method. This will gracefully close any open WebSocket or | |||||
| UdpSocket connections. | |||||
| Since the Start/Stop methods only signal to an underlying connection | Since the Start/Stop methods only signal to an underlying connection | ||||
| manager that a connection needs to be started, **they return before a | |||||
| manager that a connection needs to be started, **they return before a | |||||
| connection is actually made.** | connection is actually made.** | ||||
| As a result, you will need to hook into one of the connection-state | As a result, you will need to hook into one of the connection-state | ||||
| @@ -24,25 +24,25 @@ ready for use. | |||||
| All clients provide a `Connected` and `Disconnected` event, which is | All clients provide a `Connected` and `Disconnected` event, which is | ||||
| raised respectively when a connection opens or closes. In the case of | raised respectively when a connection opens or closes. In the case of | ||||
| the DiscordSocketClient, this does **not** mean that the client is | |||||
| the [DiscordSocketClient], this does **not** mean that the client is | |||||
| ready to be used. | ready to be used. | ||||
| A separate event, `Ready`, is provided on DiscordSocketClient, which | |||||
| A separate event, `Ready`, is provided on [DiscordSocketClient], which | |||||
| is raised only when the client has finished guild stream or guild | is raised only when the client has finished guild stream or guild | ||||
| sync, and has a complete guild cache. | sync, and has a complete guild cache. | ||||
| [DiscordSocketClient]: xref:Discord.WebSocket.DiscordSocketClient | [DiscordSocketClient]: xref:Discord.WebSocket.DiscordSocketClient | ||||
| [DiscordRpcClient]: xref:Discord.Rpc.DiscordRpcClient | |||||
| ### Samples | ### Samples | ||||
| [!code-csharp[Connection Sample](samples/events.cs)] | [!code-csharp[Connection Sample](samples/events.cs)] | ||||
| ### Tips | |||||
| ### Reconnection | |||||
| Avoid running long-running code on the gateway! If you deadlock the | |||||
| gateway (as explained in [events]), the connection manager will be | |||||
| unable to recover and reconnect. | |||||
| > [!TIP] | |||||
| > Avoid running long-running code on the gateway! If you deadlock the | |||||
| > gateway (as explained in [events]), the connection manager will be | |||||
| > unable to recover and reconnect. | |||||
| Assuming the client disconnected because of a fault on Discord's end, | Assuming the client disconnected because of a fault on Discord's end, | ||||
| and not a deadlock on your end, we will always attempt to reconnect | and not a deadlock on your end, we will always attempt to reconnect | ||||
| @@ -52,4 +52,4 @@ Don't worry about trying to maintain your own connections, the | |||||
| connection manager is designed to be bulletproof and never fail - if | connection manager is designed to be bulletproof and never fail - if | ||||
| your client doesn't manage to reconnect, you've found a bug! | your client doesn't manage to reconnect, you've found a bug! | ||||
| [events]: events.md | |||||
| [events]: xref:Guides.Concepts.Events | |||||
| @@ -1,4 +1,5 @@ | |||||
| --- | --- | ||||
| uid: Guides.Concepts.Entities | |||||
| title: Entities | title: Entities | ||||
| --- | --- | ||||
| @@ -11,7 +12,7 @@ title: Entities | |||||
| Discord.Net provides a versatile entity system for navigating the | Discord.Net provides a versatile entity system for navigating the | ||||
| Discord API. | Discord API. | ||||
| ### Inheritance | |||||
| ## Inheritance | |||||
| Due to the nature of the Discord API, some entities are designed with | Due to the nature of the Discord API, some entities are designed with | ||||
| multiple variants; for example, `SocketUser` and `SocketGuildUser`. | multiple variants; for example, `SocketUser` and `SocketGuildUser`. | ||||
| @@ -30,14 +31,14 @@ But that doesn't mean a message _can't_ come from a | |||||
| retrieve information about a guild from a message entity, you will | retrieve information about a guild from a message entity, you will | ||||
| need to cast its channel object to a `SocketTextChannel`. | need to cast its channel object to a `SocketTextChannel`. | ||||
| ### Navigation | |||||
| ## Navigation | |||||
| All socket entities have navigation properties on them, which allow | All socket entities have navigation properties on them, which allow | ||||
| you to easily navigate to an entity's parent or children. As explained | you to easily navigate to an entity's parent or children. As explained | ||||
| above, you will sometimes need to cast to a more detailed version of | above, you will sometimes need to cast to a more detailed version of | ||||
| an entity to navigate to its parent. | an entity to navigate to its parent. | ||||
| ### Accessing Entities | |||||
| ## Accessing Entities | |||||
| The most basic forms of entities, `SocketGuild`, `SocketUser`, and | The most basic forms of entities, `SocketGuild`, `SocketUser`, and | ||||
| `SocketChannel` can be pulled from the DiscordSocketClient's global | `SocketChannel` can be pulled from the DiscordSocketClient's global | ||||
| @@ -56,6 +57,6 @@ entities, e.g. `SocketGuild.GetUser`, which returns a | |||||
| `SocketGuildChannel`. Again, you may need to cast these objects to get | `SocketGuildChannel`. Again, you may need to cast these objects to get | ||||
| a variant of the type that you need. | a variant of the type that you need. | ||||
| ### Sample | |||||
| ## Sample | |||||
| [!code-csharp[Entity Sample](samples/entities.cs)] | [!code-csharp[Entity Sample](samples/entities.cs)] | ||||
| @@ -1,4 +1,5 @@ | |||||
| --- | --- | ||||
| uid: Guides.Concepts.Events | |||||
| title: Working with Events | title: Working with Events | ||||
| --- | --- | ||||
| @@ -12,7 +13,7 @@ event's parameters are passed directly into the handler. | |||||
| This allows for events to be handled in an async context directly | This allows for events to be handled in an async context directly | ||||
| instead of relying on `async void`. | instead of relying on `async void`. | ||||
| ### Usage | |||||
| ## Usage | |||||
| To receive data from an event, hook into it using C#'s delegate | To receive data from an event, hook into it using C#'s delegate | ||||
| event pattern. | event pattern. | ||||
| @@ -20,7 +21,7 @@ event pattern. | |||||
| You may either opt to hook an event to an anonymous function (lambda) | You may either opt to hook an event to an anonymous function (lambda) | ||||
| or a named function. | or a named function. | ||||
| ### Safety | |||||
| ## Safety | |||||
| All events are designed to be thread-safe; events are executed | All events are designed to be thread-safe; events are executed | ||||
| synchronously off the gateway task in the same context as the gateway | synchronously off the gateway task in the same context as the gateway | ||||
| @@ -41,7 +42,7 @@ a deadlock that will be impossible to recover from. | |||||
| Exceptions in commands will be swallowed by the gateway and logged out | Exceptions in commands will be swallowed by the gateway and logged out | ||||
| through the client's log method. | through the client's log method. | ||||
| ### Common Patterns | |||||
| ## Common Patterns | |||||
| As you may know, events in Discord.Net are only given a signature of | As you may know, events in Discord.Net are only given a signature of | ||||
| `Func<T1, ..., Task>`. There is no room for predefined argument names, | `Func<T1, ..., Task>`. There is no room for predefined argument names, | ||||
| @@ -51,7 +52,7 @@ directly. | |||||
| That being said, there are a variety of common patterns that allow you | That being said, there are a variety of common patterns that allow you | ||||
| to infer what the parameters in an event mean. | to infer what the parameters in an event mean. | ||||
| #### Entity, Entity | |||||
| ### Entity, Entity | |||||
| An event handler with a signature of `Func<Entity, Entity, Task>` | An event handler with a signature of `Func<Entity, Entity, Task>` | ||||
| typically means that the first object will be a clone of the entity | typically means that the first object will be a clone of the entity | ||||
| @@ -60,7 +61,7 @@ model of the entity _after_ the change was made. | |||||
| This pattern is typically only found on `EntityUpdated` events. | This pattern is typically only found on `EntityUpdated` events. | ||||
| #### Cacheable | |||||
| ### Cacheable | |||||
| An event handler with a signature of `Func<Cacheable, Entity, Task>` | An event handler with a signature of `Func<Cacheable, Entity, Task>` | ||||
| means that the `before` state of the entity was not provided by the | means that the `before` state of the entity was not provided by the | ||||
| @@ -78,6 +79,6 @@ object. | |||||
| > **not** enabled by default. Set the `MessageCacheSize` flag in | > **not** enabled by default. Set the `MessageCacheSize` flag in | ||||
| > @Discord.WebSocket.DiscordSocketConfig to enable it. | > @Discord.WebSocket.DiscordSocketConfig to enable it. | ||||
| ### Sample | |||||
| ## Sample | |||||
| [!code-csharp[Event Sample](samples/events.cs)] | [!code-csharp[Event Sample](samples/events.cs)] | ||||
| @@ -1,4 +1,5 @@ | |||||
| --- | --- | ||||
| uid: Guides.Concepts.Logging | |||||
| title: Logging | title: Logging | ||||
| --- | --- | ||||
| @@ -10,7 +11,7 @@ dispatched over. | |||||
| For more information about events in Discord.Net, see the [Events] | For more information about events in Discord.Net, see the [Events] | ||||
| section. | section. | ||||
| [Events]: events.md | |||||
| [Events]: xref:Guides.Concepts.Events | |||||
| > [!WARNING] | > [!WARNING] | ||||
| > Due to the nature of Discord.Net's event system, all log event | > Due to the nature of Discord.Net's event system, all log event | ||||
| @@ -19,7 +20,7 @@ section. | |||||
| > to wrap your output in a `Task.Run` so the gateway thread does not | > to wrap your output in a `Task.Run` so the gateway thread does not | ||||
| > become blocked while waiting for logging data to be written. | > become blocked while waiting for logging data to be written. | ||||
| ### Usage in Client(s) | |||||
| ## Usage in Client(s) | |||||
| To receive log events, simply hook the Discord client's @Discord.Rest.BaseDiscordClient.Log | To receive log events, simply hook the Discord client's @Discord.Rest.BaseDiscordClient.Log | ||||
| to a `Task` with a single parameter of type [LogMessage]. | to a `Task` with a single parameter of type [LogMessage]. | ||||
| @@ -30,7 +31,7 @@ to a logging function to write their own messages. | |||||
| [LogMessage]: xref:Discord.LogMessage | [LogMessage]: xref:Discord.LogMessage | ||||
| ### Usage in Commands | |||||
| ## Usage in Commands | |||||
| Discord.Net's [CommandService] also provides a @Discord.Commands.CommandService.Log | Discord.Net's [CommandService] also provides a @Discord.Commands.CommandService.Log | ||||
| event, identical in signature to other log events. | event, identical in signature to other log events. | ||||
| @@ -42,6 +43,6 @@ and error can be found and handled. | |||||
| [CommandService]: xref:Discord.Commands.CommandService | [CommandService]: xref:Discord.Commands.CommandService | ||||
| [CommandException]: xref:Discord.Commands.CommandException | [CommandException]: xref:Discord.Commands.CommandException | ||||
| ### Sample | |||||
| ## Sample | |||||
| [!code-csharp[Logging Sample](samples/logging.cs)] | [!code-csharp[Logging Sample](samples/logging.cs)] | ||||
| @@ -1,5 +1,6 @@ | |||||
| --- | --- | ||||
| title: Getting Started | |||||
| uid: Guides.GettingStarted.FirstBot | |||||
| title: Start making a bot | |||||
| --- | --- | ||||
| # Making a Ping-Pong bot | # Making a Ping-Pong bot | ||||
| @@ -25,8 +26,8 @@ account on Discord. | |||||
|  |  | ||||
| 6. Confirm the popup. | 6. Confirm the popup. | ||||
| 7. If this bot will be public, check "Public Bot." **Do not tick any | |||||
| other options!** | |||||
| 7. If this bot will be public, check "Public Bot." **Do not tick any | |||||
| other options!** | |||||
| [Discord Applications Portal]: https://discordapp.com/developers/applications/me | [Discord Applications Portal]: https://discordapp.com/developers/applications/me | ||||
| @@ -55,7 +56,7 @@ through the OAuth2 flow. | |||||
| ## Connecting to Discord | ## Connecting to Discord | ||||
| If you have not already created a project and installed Discord.Net, | If you have not already created a project and installed Discord.Net, | ||||
| do that now. (see the [Installing](installing.md) section) | |||||
| do that now. (see the [Installing](xref:Guides.GettingStarted.Installation) section) | |||||
| ### Async | ### Async | ||||
| @@ -109,7 +110,7 @@ the Console. | |||||
| Finally, we can create a connection to Discord. Since we are writing | Finally, we can create a connection to Discord. Since we are writing | ||||
| a bot, we will be using a [DiscordSocketClient] along with socket | a bot, we will be using a [DiscordSocketClient] along with socket | ||||
| entities. See the [terminology](terminology.md) if you're unsure of | |||||
| entities. See the [terminology](xref:Guides.GettingStarted.Terminology) if you're unsure of | |||||
| the differences. | the differences. | ||||
| To do so, create an instance of [DiscordSocketClient] in your async | To do so, create an instance of [DiscordSocketClient] in your async | ||||
| @@ -161,7 +162,7 @@ online in Discord. | |||||
| > for how to fix this. | > for how to fix this. | ||||
| [DiscordSocketClient]: xref:Discord.WebSocket.DiscordSocketClient | [DiscordSocketClient]: xref:Discord.WebSocket.DiscordSocketClient | ||||
| [installation guide]: installing.md#installing-on-net-standard-11 | |||||
| [installation guide]: xref:Guides.GettingStarted.Installation#installing-on-net-standard-11 | |||||
| ### Handling a 'ping' | ### Handling a 'ping' | ||||
| @@ -213,12 +214,12 @@ For your reference, you may view the [completed program]. | |||||
| [SocketMessage]: xref:Discord.WebSocket.SocketMessage | [SocketMessage]: xref:Discord.WebSocket.SocketMessage | ||||
| [SocketMessageChannel]: xref:Discord.WebSocket.ISocketMessageChannel | [SocketMessageChannel]: xref:Discord.WebSocket.ISocketMessageChannel | ||||
| [completed program]: samples/intro/complete.cs | [completed program]: samples/intro/complete.cs | ||||
| [Command Guide]: ../commands/commands.md | |||||
| [Command Guide]: xref:Guides.Commands.Intro | |||||
| # Building a bot with commands | # Building a bot with commands | ||||
| This section will show you how to write a program that is ready for | This section will show you how to write a program that is ready for | ||||
| [Commands](../commands/commands.md). Note that we will not be | |||||
| [Commands](xref:Guides.Commands.Intro). Note that we will not be | |||||
| explaining _how_ to write Commands or Services, it will only be | explaining _how_ to write Commands or Services, it will only be | ||||
| covering the general structure. | covering the general structure. | ||||
| @@ -1,4 +1,5 @@ | |||||
| --- | --- | ||||
| uid: Guides.GettingStarted.Installation | |||||
| title: Installing Discord.Net | title: Installing Discord.Net | ||||
| --- | --- | ||||
| @@ -1,5 +1,5 @@ | |||||
| --- | --- | ||||
| uid: Terminology | |||||
| uid: Guides.GettingStarted.Terminology | |||||
| title: Terminology | title: Terminology | ||||
| --- | --- | ||||
| @@ -1,3 +1,8 @@ | |||||
| --- | |||||
| uid: Guides.Introduction | |||||
| title: Introduction to Discord.NET | |||||
| --- | |||||
| # Introduction | # Introduction | ||||
| ## Looking to get started? | ## Looking to get started? | ||||
| @@ -1,28 +1,28 @@ | |||||
| - name: Introduction | - name: Introduction | ||||
| href: introduction/intro.md | |||||
| topicUid: Guides.Introduction | |||||
| - name: Getting Started | - name: Getting Started | ||||
| items: | items: | ||||
| - name: Installation | - name: Installation | ||||
| href: getting_started/installing.md | |||||
| topicUid: Guides.GettingStarted.Installation | |||||
| - name: Your First Bot | - name: Your First Bot | ||||
| href: getting_started/first-bot.md | |||||
| topicUid: Guides.GettingStarted.FirstBot | |||||
| - name: Terminology | - name: Terminology | ||||
| href: getting_started/terminology.md | |||||
| topicUid: Guides.GettingStarted.Terminology | |||||
| - name: Basic Concepts | - name: Basic Concepts | ||||
| items: | items: | ||||
| - name: Logging Data | - name: Logging Data | ||||
| href: concepts/logging.md | |||||
| topicUid: Guides.Concepts.Logging | |||||
| - name: Working with Events | - name: Working with Events | ||||
| href: concepts/events.md | |||||
| topicUid: Guides.Concepts.Events | |||||
| - name: Managing Connections | - name: Managing Connections | ||||
| href: concepts/connections.md | |||||
| topicUid: Guides.Concepts.ManageConnections | |||||
| - name: Entities | - name: Entities | ||||
| href: concepts/entities.md | |||||
| topicUid: Guides.Concepts.Entities | |||||
| - name: The Command Service | - name: The Command Service | ||||
| items: | items: | ||||
| - name: Command Guide | - name: Command Guide | ||||
| href: commands/commands.md | |||||
| topicUid: Guides.Commands.Intro | |||||
| - name: Post-execution Handling | - name: Post-execution Handling | ||||
| href: commands/post-execution.md | |||||
| topicUid: Guides.Commands.PostExecution | |||||
| - name: Voice | - name: Voice | ||||
| href: voice/sending-voice.md | |||||
| topicUid: Guides.Voice.SendingVoice | |||||
| @@ -1,4 +1,5 @@ | |||||
| --- | --- | ||||
| uid: Guides.Voice.SendingVoice | |||||
| title: Sending Voice | title: Sending Voice | ||||
| --- | --- | ||||
| @@ -1,3 +1,8 @@ | |||||
| --- | |||||
| uid: Root.Landing | |||||
| title: Home | |||||
| --- | |||||
| # Discord.Net Documentation | # Discord.Net Documentation | ||||
| ## What is Discord.NET? | ## What is Discord.NET? | ||||
| @@ -8,9 +13,10 @@ interface with the [Discord API](https://discordapp.com/). | |||||
| ## Where to begin? | ## Where to begin? | ||||
| If this is your first time using Discord.Net, you should refer to the | If this is your first time using Discord.Net, you should refer to the | ||||
| [Intro](guides/introduction/intro.md) for tutorials. | |||||
| More experienced users might refer to the | |||||
| [API Documentation](api/index.md) for a breakdown of the individuals | |||||
| [Intro](xref:Guides.Introduction) for tutorials. | |||||
| More experienced users might want to refer to the | |||||
| [API Documentation](xref:API.Docs) for a breakdown of the individual | |||||
| objects in the library. | objects in the library. | ||||
| ## Additional Resources | ## Additional Resources | ||||
| @@ -1,7 +1,9 @@ | |||||
| - name: Guides | - name: Guides | ||||
| href: guides/ | href: guides/ | ||||
| topicUid: Guides.Introduction | |||||
| - name: FAQ | - name: FAQ | ||||
| href: faq/ | href: faq/ | ||||
| topicUid: FAQ.Basics.GetStarted | |||||
| - name: API Documentation | - name: API Documentation | ||||
| href: api/ | href: api/ | ||||
| homepage: api/index.md | |||||
| topicUid: API.Docs | |||||