* Remove template in favor of official samples
* Fixed a variable name copy pasta mistake
line 35 was _database.GetData() instead of DBService.GetData()
* Experimental theme change
* Change paragraph, code, heading fonts
* Widen viewport
* Update DocFX.Plugins.LastModified v1.2.3
* Exclude Discord.API in docs
* Add remarks for SocketReaction properties
* Add examples for BaseSocketClient.Events
* Add additional clarification for some methods
* Move IUser and IGuildChannel examples
* Clarify several guides samples with notes
- Reword TypeReader comment to avoid giving the idea that the sample itself is "obsolete"
- Remove CommandException logging comment regarding C#7.0 as the version is now the standard across VS2017 and up
- Remove suggestion about handling result in command handler since it is now advised to use CommandExecuted instead
+ Add additional comment to clarify ctor for DI setup
* Add/migrate code examples
* Incorporate material design theme
License @ https://github.com/ovasquez
* Update installation and nightly guide
* Fix improper indentations made obvious by the widen viewport
* Fix minor grammar issues
+ Add installation for nightly build using dotnet CLI
* Fix nav level indentation
* Revise "Your First Bot" article
* Merge some paragraphs to avoid clutter while keeping readability
* Reword the use of command framework
+ Add additional warning/note about environment variable
* Add additional indent level
* Fix indentation text warping
* Remove connections sample
* Update logging sample
Remove redundant part of the sample
* Remove mention of RPC
* Remove misleading section about commands
- Remove command sample from complete snippet
* Revise "Your First Bot" command paragraphs
* Change wording to hint devs that additional command parser packages may be available, as more and more begin to crop up
* Update themes
* Add XML docs contribution guidelines
Update guidelines
* Update CommandExecuted remarks
* Fix precondition remarks typo
no one saw that ok
* Fix permission sample in docfx
* Fix IMessageChannel samples
* Update docs/_template/light-dark-theme/styles/docfx.vendor.minify.css
Co-Authored-By: Still34 <341464@gmail.com>
* Update docs/_template/light-dark-theme/styles/material.css
Co-Authored-By: Still34 <341464@gmail.com>
* Update docs/_template/light-dark-theme/styles/material.css
Co-Authored-By: Still34 <341464@gmail.com>
@@ -128,12 +128,10 @@ Finally, we can create a new connection to Discord.
Since we are writing a bot, we will be using a [DiscordSocketClient]
Since we are writing a bot, we will be using a [DiscordSocketClient]
along with socket entities. See @Guides.GettingStarted.Terminology
along with socket entities. See @Guides.GettingStarted.Terminology
if you are unsure of the differences.
To establish a new connection, we will create an instance of
[DiscordSocketClient] in the new async main. You may pass in an
optional @Discord.WebSocket.DiscordSocketConfig if necessary. For most
users, the default will work fine.
if you are unsure of the differences. To establish a new connection,
we will create an instance of [DiscordSocketClient] in the new async
main. You may pass in an optional @Discord.WebSocket.DiscordSocketConfig
if necessary. For most users, the default will work fine.
Before connecting, we should hook the client's `Log` event to the
Before connecting, we should hook the client's `Log` event to the
log handler that we had just created. Events in Discord.Net work
log handler that we had just created. Events in Discord.Net work
@@ -142,22 +140,33 @@ similarly to any other events in C#.
Next, you will need to "log in to Discord" with the [LoginAsync]
Next, you will need to "log in to Discord" with the [LoginAsync]
method with the application's "token."
method with the application's "token."

> [!NOTE]
> [!NOTE]
> Pay attention to what you are copying from the developer portal!
> Pay attention to what you are copying from the developer portal!
> A token is not the same as the application's "client secret."
> A token is not the same as the application's "client secret."

> [!IMPORTANT]
> [!IMPORTANT]
> Your bot's token can be used to gain total access to your bot, so
> Your bot's token can be used to gain total access to your bot, so
> **do __NOT__ share this token with anyone else!** It may behoove you
> to store this token in an external source if you plan on distributing
> **do not** share this token with anyone else! You should store this
> token in an external source if you plan on distributing
> the source code for your bot.
> the source code for your bot.
>
> In the following example, we retrieve the token from the environment
> variable `DiscordToken`. Please note that this is *not* designed to
> be used in a production environment, as the secrets are stored in
> plain-text.
>
> For information on how to set an environment variable, please see
> instructions below,
>
> * Windows: [How to Create Environment Variables Shortcut in Windows](https://www.tenforums.com/tutorials/121742-create-environment-variables-shortcut-windows.html)
> * Linux: [How To Read and Set Environmental and Shell Variables on a Linux VPS](https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps)
> * macOS: [How do I set environment variables on OS X?](https://apple.stackexchange.com/questions/106778/how-do-i-set-environment-variables-on-os-x)
We may now invoke the client's [StartAsync] method, which will
We may now invoke the client's [StartAsync] method, which will
start connection/reconnection logic. It is important to note that
start connection/reconnection logic. It is important to note that
**this method will return as soon as connection logic has been started!**
**this method will return as soon as connection logic has been started!**
Any methods that rely on the client's state should go in an event
Any methods that rely on the client's state should go in an event
handler. This means that you should **not** directly be interacting with
handler. This means that you should **not** directly be interacting with
the client before it is fully ready.
the client before it is fully ready.
@@ -173,81 +182,34 @@ The following lines can now be added:
At this point, feel free to start your program and see your bot come
At this point, feel free to start your program and see your bot come
online in Discord.
online in Discord.
> [!TIP]
> [!WARNING]
> Getting a warning about `A supplied token was invalid.` and/or
> Getting a warning about `A supplied token was invalid.` and/or
> having trouble logging in? Double-check whether you have put in
> having trouble logging in? Double-check whether you have put in
> the correct credentials and make sure that it is _not_ a client
> the correct credentials and make sure that it is _not_ a client
> secret, which is different from a token.
> secret, which is different from a token.
> [!TIP]
> [!WARNING]
> Encountering a `PlatformNotSupportedException` when starting your bot?
> Encountering a `PlatformNotSupportedException` when starting your bot?
> This means that you are targeting a platform where .NET's default
> This means that you are targeting a platform where .NET's default
> WebSocket client is not supported. Refer to the [installation guide]
> WebSocket client is not supported. Refer to the [installation guide]
> for how to fix this.
> for how to fix this.
> [!NOTE]
> For your reference, you may view the [completed program].
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.