diff --git a/docs/faq/basics/basic-operations.md b/docs/faq/basics/basic-operations.md index 55eb80fca..94d4ed8fc 100644 --- a/docs/faq/basics/basic-operations.md +++ b/docs/faq/basics/basic-operations.md @@ -89,7 +89,7 @@ returned by a Discord response. ## Why am I getting so many preemptive rate limits when I try to add more than one reactions? This is due to how HTML header works, mistreating -0.25sec/action to 1sec. This casues the lib to throw preemptive rate +0.25sec/action to 1sec. This causes the lib to throw preemptive rate limit more frequently than it should for methods such as adding reactions. diff --git a/docs/faq/misc/Glossary.md b/docs/faq/misc/Glossary.md index 32246886d..44dbb9a9e 100644 --- a/docs/faq/misc/Glossary.md +++ b/docs/faq/misc/Glossary.md @@ -10,8 +10,9 @@ title: Common Terminologies / Glossary * A **Guild** ([IGuild]) is an isolated collection of users and channels, and are often referred to as "servers". - Example: [Discord API](https://discord.gg/jkrBmQR) -* A **Channel** ([IChannel]) represents either a voice or text channel. +* A **Channel** ([IChannel]) represents a generic channel. - Example: #dotnet_discord-net + - See [Channel Types](#channel-types) [IGuild]: xref:Discord.IGuild [IChannel]: xref:Discord.IChannel diff --git a/docs/guides/commands/preconditions.md b/docs/guides/commands/preconditions.md index f3b79f505..7fe6dd3a8 100644 --- a/docs/guides/commands/preconditions.md +++ b/docs/guides/commands/preconditions.md @@ -5,7 +5,7 @@ title: Preconditions # Preconditions -Precondition serve as a permissions system for your Commands. Keep in +Preconditions serve as a permissions system for your Commands. Keep in mind, however, that they are not limited to _just_ permissions and can be as complex as you want them to be. @@ -21,8 +21,8 @@ You may visit their respective API documentation to find out more. ## Bundled Preconditions -@Discord.Commands ship with several bundled Preconditions; you may -view their usages on their respective API pages. +@Discord.Commands ships with several bundled Preconditions for you +to use. * @Discord.Commands.RequireContextAttribute * @Discord.Commands.RequireOwnerAttribute @@ -39,13 +39,18 @@ depending on your use. In order for your Precondition to function, you will need to override the [CheckPermissionsAsync] method. -Your IDE should provide an option to fill this in for you. - If the context meets the required parameters, return [PreconditionResult.FromSuccess], otherwise return [PreconditionResult.FromError] and include an error message if necessary. +> [!NOTE] +> Visual Studio can help you implement missing members +> from the abstract class by using the "Implement Abstract Class" +> IntelliSense hint. + +### Example - Creating a Custom Precondition + [!code-csharp[Custom Precondition](samples/require_owner.cs)] [CheckPermissionsAsync]: xref:Discord.Commands.PreconditionAttribute.CheckPermissionsAsync*