[Docs] Remove some redundant notes & small updates (#2847)

* remove outdated notes

* Update general.md

* Update creating-slash-commands.md

* Update add note about interaction framework

* typo

* use xref

* Update intro.md

* improve docs workflow

* Update README.md
This commit is contained in:
Mihail Gribkov
2024-02-24 14:22:14 +03:00
committed by GitHub
parent eb5678aea5
commit d0e9c8bd97
6 changed files with 43 additions and 17 deletions

View File

@@ -4,7 +4,14 @@ on:
push: push:
tags: tags:
- '*' - '*'
paths:
- 'docs/**'
workflow_dispatch: workflow_dispatch:
pull_request:
paths:
- 'docs/**'
branches:
- dev
jobs: jobs:
build: build:
@@ -24,9 +31,26 @@ jobs:
- name: Build DNet docs - name: Build DNet docs
run: docfx docs/docfx.json run: docfx docs/docfx.json
- name: Create Output Directory - name: Upload Artifacts
run: mkdir output | cp -a docs/_site/. output/ uses: actions/upload-artifact@v4
with:
name: static-docs
path: docs/_site
deploy:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: static-docs
path: output/
- name: Auth DNet bot - name: Auth DNet bot
id: bot_auth id: bot_auth
uses: machine-learning-apps/actions-app-token@master uses: machine-learning-apps/actions-app-token@master
@@ -34,7 +58,7 @@ jobs:
APP_PEM: ${{ secrets.DNET_BOT_PEM }} APP_PEM: ${{ secrets.DNET_BOT_PEM }}
APP_ID: ${{ secrets.DNET_BOT_ID }} APP_ID: ${{ secrets.DNET_BOT_ID }}
- name: Push to static docs - name: Push to the Docs Repo
uses: cpina/github-action-push-to-another-repository@main uses: cpina/github-action-push-to-another-repository@main
env: env:
API_TOKEN_GITHUB: ${{ steps.bot_auth.outputs.app_token }} API_TOKEN_GITHUB: ${{ steps.bot_auth.outputs.app_token }}

View File

@@ -17,7 +17,7 @@
<img src="https://discord.com/api/guilds/848176216011046962/widget.png" alt="Discord"> <img src="https://discord.com/api/guilds/848176216011046962/widget.png" alt="Discord">
</a> </a>
</p> </p>
Discord.Net is an unofficial .NET API Wrapper for the Discord client (https://discord.com). Discord.Net is an unofficial .NET API Wrapper for the Discord API (https://discord.com).
## 📄 Documentation ## 📄 Documentation

View File

@@ -43,17 +43,17 @@ Ideally, use pattern matching to make sure its the type of interaction you are e
## My interaction commands are not showing up? ## My interaction commands are not showing up?
If you registered your commands globally, it can take up to 1 hour for them to register.
Did you register a guild command (should be instant), or waited more than an hour and still don't have them show up?
- Try to check for any errors in the console, there is a good chance something might have been thrown. - Try to check for any errors in the console, there is a good chance something might have been thrown.
- - Make sure you have setup logging. If you use `InteractionService` hook into [`InteractionService.Log`]) event
- Register your commands after the Ready event in the client. The client is not configured to register commands before this moment. - Register your commands after the Ready event in the client. The client is not configured to register commands before this moment.
- Check if no bad form exception is thrown; If so, refer to the above question. - Check if no bad form exception is thrown;
- Do you have the application commands scope checked when adding your bot to guilds? - Do you have the application commands scope checked when adding your bot to guilds?
- Try reloading your Discord client. On desktop it's done with `Ctrl+R` key combo.
## Do I need to create commands on startup? ## Do I need to create commands on startup?
If you are registering your commands for the first time, it is required to create them once. If you are registering your commands for the first time, it is required to create them once.
@@ -65,3 +65,6 @@ Overwriting is only required if you make changes to existing commands, or add ne
Message and user commands have a limit of 5 per guild, and another 5 globally. Message and user commands have a limit of 5 per guild, and another 5 globally.
If you have more than 5 guild-only message commands being registered, no more than 5 will actually show up. If you have more than 5 guild-only message commands being registered, no more than 5 will actually show up.
You can get up to 10 entries to show if you register 5 per guild, and another 5 globally. You can get up to 10 entries to show if you register 5 per guild, and another 5 globally.
[`InteractionService.Log`]: xref:Discord.Interactions.InteractionService.Log

View File

@@ -8,7 +8,11 @@ title: Introduction to slash commands
This guide will show you how to use application commands. This guide will show you how to use application commands.
If you have extra questions that aren't covered here you can come to our If you have extra questions that aren't covered here you can come to our
[Discord](https://discord.com/invite/dvSfUTet3K) server and ask around there. [Discord](https://discord.gg/dnet) server and ask around there.
> [!NOTE]
> This guide shows the manual way of creating and handling application commands. We recommend using the Interaction Framework because it allows you to work with application commands
> and handle interactions in a much simpler and structurized way. You can find more info in the [Interaction Framework Intro] docs.
## What is an application command? ## What is an application command?
@@ -46,3 +50,5 @@ From there you can then use the link to add your bot to a server.
> [!NOTE] > [!NOTE]
> In order for users in your guild to use your slash commands, they need to have > In order for users in your guild to use your slash commands, they need to have
> the "Use Application Commands" permission on the guild. > the "Use Application Commands" permission on the guild.
[Interaction Framework Intro]: xref:Guides.IntFw.Intro

View File

@@ -17,8 +17,6 @@ Guild commands are specific to the guild you specify when making them. Guild com
**Note**: Apps can have a maximum of 100 global commands, and an additional 100 guild-specific commands per guild. **Note**: Apps can have a maximum of 100 global commands, and an additional 100 guild-specific commands per guild.
**Note**: Global commands will take up to 1 hour to create, delete or modify on guilds. If you need to update a command quickly for testing you can create it as a guild command.
If you don't have the code for a bot ready yet please follow [this guide](https://discordnet.dev/guides/getting_started/first-bot.html). If you don't have the code for a bot ready yet please follow [this guide](https://discordnet.dev/guides/getting_started/first-bot.html).
## SlashCommandBuilder ## SlashCommandBuilder

View File

@@ -352,11 +352,6 @@ can be used to register cherry picked modules or commands to global/guild scopes
> [!NOTE] > [!NOTE]
> [DontAutoRegisterAttribute] can be used on module classes to prevent `RegisterCommandsGloballyAsync()` and `RegisterCommandsToGuildAsync()` from registering them to the Discord. > [DontAutoRegisterAttribute] can be used on module classes to prevent `RegisterCommandsGloballyAsync()` and `RegisterCommandsToGuildAsync()` from registering them to the Discord.
> [!NOTE]
> In debug environment, since Global commands can take up to 1 hour to register/update,
> it is advised to register your commands to a test guild for your changes to take effect immediately.
> You can use preprocessor directives to create a simple logic for registering commands as seen above.
## Interaction Utility ## Interaction Utility
Interaction Service ships with a static `InteractionUtility` Interaction Service ships with a static `InteractionUtility`