Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: rewrite and elaborate for improved brevity & clarity #23

Merged
merged 4 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions content/core/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ title = "Core"
weight = 3
+++

This chapter covers everything under the **Core** category on the control panel, probably one of the most important
categories — especially during your initial setup.
Under the **Core** category of the control panel, you can configure access to
some of YAGPDB's key functionality and view a log of changes to server
configuration.

{{%children containerstyle="div" style="h2" description="true" %}}
84 changes: 49 additions & 35 deletions content/core/command-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,64 @@ Fine-grained control over all of YAGPDB's inbuilt commands.

## Overview

Command overrides enable you to impose fine-grained control over all of YAGPDB's inbuilt commands. Before we go into
greater detail, a quick overview of that page below.
Command overrides allow you to restrict access to YAGPDB's inbuilt commands and optionally configure intervals after
which the command trigger and response will be autodeleted. The key features of the page are as follows:

![Overview of the Command Settings page.](command_settings_overview.png)

<center>

**1** Command prefix, default `-` **2** *All commands enabled* setting **3** Required roles **4** Ignored roles
**1** Command prefix, default `-` **2** _All commands enabled_ setting **3** Required roles **4** Ignored roles
**5** Autodelete trigger interval **6** Autodelete response interval **7** Command overrides **8** Channel overrides tabs

</center>

The prefix setting (**1**) should be relatively straight-forward; whatever you type in that text-box, that becomes your
prefix. Slash commands, which use Discord's API to add them to your client's interface, are obviously still prefixed
by a slash `/`.
The prefix (**1**) is a short sequence of characters that trigger YAGPDB commands. By default, the prefix is `-`. Thus,
for instance, the `remindme` command is invoked by prefixing the command name with a hyphen: `-remindme ...`. If the
prefix was instead `?`, one would use `?remindme ...`, and so on.

As a small bonus, YAGPDB will also consider a ping at the start of a message as a command prefix, which is quite helpful
when you forgot it, as simply sending `@YAGPDB.xyz prefix` will help you remember it.
Slash commands are always triggered using the `/` character and hence do not depend on the prefix configured here.

Commands will not work when *All commands enabled* (**2**) is not checked.
{{% notice style="tip" %}}

{{% notice style="tip" title="Flags and Switches" %}}
In addition to the command prefix, you can trigger YAGPDB commands by pinging the bot at the start of your message. This
is helpful if you forget your prefix, as sending `@YAGPDB.xyz prefix` will recall it.

Flags and switches are ***not*** affected by your prefix setting.
{{% /notice %}}

{{% notice style="warning" title="Flags and Switches" %}}

Flags and switches are **_not_** affected by your prefix setting.

For example, if your prefix is `?`, a command usage with flags and/or switches would look like the following:
For example, if your prefix is `?`, a command usage with flags and/or switches is as follows:

```
?wouldyourather -raw
```

where the `raw` switch is still spelled `-raw`, not `?raw`.

{{% /notice %}}

### Command Override Priority

Command overrides and related settings are checked and applied in a very specific order, later settings completely
overwriting earlier ones.
Command overrides are considered in the following order, with settings applied at later steps overwriting earlier ones:

1. If the _All commands enabled_ setting is not checked, all commands are initially disabled (otherwise enabled.)
2. General restrictions configured in _Global Settings_ are then applied, base restrictions before command-specific restrictions.
3. Channel-specific restrictions (_Override #1_, _Override #2_, ...) are applied analogously.

First, the bot checks whether all commands are enabled. After that, overrides found in *Global Settings* are applied,
which can enable or disable specific commands.
The order above trickles down from least specific to most specific, prioritizing the most specific setting -- an analogy
for developers would be CSS's cascading rules.

The penultimate step is applying *Channel Overrides*, if applicable. Finally, command overrides found in there are applied.
{{% notice style="info" title="Example" %}}

Admittedly, this is at first relatively confusing, however there is a system to this madness. Essentially it trickles
down from least specific to most specific, giving the most specific setting priority. If you know about CSS's cascading
rules, this should be somewhat familiar.
Though perhaps confusing at first, the priority order above is designed to make common configurations trivial. For
instance, to disable all but a specific command -- say the `remindme` command -- one can simply disable the _All
commands enabled_ option and then create a command override that enables only `remindme`. This is possible as command
overrides are applied after the _All commands enabled_ setting.

{{% /notice %}}

## Options

Expand All @@ -66,50 +78,52 @@ overrides.
#### Required and Ignored Roles

Clicking on either of these options (**3**,**4**) opens a drop-down menu with all the roles present on your server.
Select as many as you wish. YAGPDB will then either require any and all members to have any of these roles, or
completely ignore members with any of the ignored roles, server admins and owners included.
Select as many as you wish. YAGPDB will then either require all members to have any of these roles in order to run
commands, or completely ignore members with any of the ignored roles, server admins and owners included.

{{% notice style="note" %}}

YAGPDB was raised well and honors a "no" when told "no". In other words, ignored roles take precedence over required
roles.

This is a relatively common trip-hazard, so take great care when you set up both required and ignored roles, and
subsequently give those roles to your members.
This is a relatively common trip-hazard, so take great care when you set up both required and ignored roles.

{{% /notice %}}

#### Autodelete Trigger / Response Interval

This setting makes YAGPDB automatically delete the triggering message and/or the response from the bot after that many
seconds have passed. To activate it, make sure to click the checkbox next to the respective input field (**5**,**6**).
This setting makes YAGPDB automatically delete the triggering message and/or its response after the configured duration
has passed. To activate it, make sure to click the checkbox next to the respective input field (**5**,**6**).

If 10 seconds are not enough, or too long, feel free to adjust as you see fit; the intervals need not be equal.

### Channel Override Options

These options are only available for channel overrides (**8**). To add a new one, head to the *New channel override*
These options are only available for channel overrides (**8**). To add a new one, head to the _New channel override_
tab on the command settings page.

{{% notice style="warning" %}}

You must select at least one channel or category; otherwise, the settings of the override will not be applied.

{{% /notice %}}

#### Channels

With this setting, you can select individual channels this override should apply to. Select as many as you wish. When
there is no channel selected, it may not apply its settings, assuming you also did not select categories.
With this setting, you can select individual channels to apply the override to. Select as many as you wish.

You find this setting in the top-left corner of any channel override.

#### Categories

Just like channels, this setting will make the override apply its settings to any channels (including future ones) in
the selected category. If there is no category selected, settings might not apply, given that you also did not select
any channels to apply to.
This setting will apply the override to all channels (including future ones) in the selected category.

You find this setting in the top-right corner of any channel override, adjacent to its channels setting.

### Command Override Options

These options are only available for individual command overrides (**7**). To add a new one, go to either your
global settings or any channel override and click on *New command override*.
global settings or any channel override and click on _New command override_.

#### Commands

Expand All @@ -120,5 +134,5 @@ or a specific channel override.
#### Enable Specified Commands

Toggling this option simply tells YAGPDB whether the commands you selected are enabled or disabled. This allows you to
disable some specific commands if, for example, you have a custom command that replaces an inbuilt one, thus
necessitating disabling said inbuilt command.
disable some specific commands, which may be useful if -- for example -- you have created a custom command that
completely replaces an inbuilt one.
5 changes: 1 addition & 4 deletions content/core/control-panel-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ Select who can view or edit your control panel.

<!--more-->

This page is relatively simple, yet very powerful. To start with, a quick overview of what it looks like:
This page is relatively simple, yet very powerful. An overview of the settings follows.

![Overview of the control panel access configuration page.](control_panel_access.png)

We'll go over the options you have from top to bottom. As usual, make sure you hit save when you change any of the
following settings.

### Read Access

#### Allow people with the following roles
Expand Down
12 changes: 6 additions & 6 deletions content/core/control-panel-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ title = 'Control Panel Logs'
weight = 2
+++

See what happened on your control panel.
View a list of recent changes to your YAGPDB configuration.

<!--more-->

This page simply lists in a very general way who edited what on the control panel, not much else going on.
Fairly useful to audit who may be responsible if things go haywire, but other than that you're probably unlikely to use
this page much.
This page is the analogue of the audit log built in to Discord for YAGPDB settings and summarizes recent edits on the
control panel, listing the time, action, and responsible user for each. It is useful to audit who may be responsible if
things go haywire, but other than that this page is unlikely to be of use.

Please don't be confused when you see someone with `destroy_0001` and the ID `598900258579283976`, as that is the bot
owner of the officially hosted instance and he may at times change things to ensure proper operation.
Please do not be confused if you see changes from the user `destroy_0001` (ID `598900258579283976`), as that is the bot
developer and he may at times need to change certain settings to ensure proper operation.

![Screenshot of some example control panel logs.](control_panel_logs.png)
Loading