Skip to content

Commit

Permalink
all: lint markdown files
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Zeuch <[email protected]>
  • Loading branch information
l-zeuch committed Dec 16, 2024
1 parent dc385fb commit a52f746
Show file tree
Hide file tree
Showing 24 changed files with 245 additions and 211 deletions.
7 changes: 3 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ General support queries and possible bugs in YAGPDB are **not** in scope and wil

[support server]: https://discord.gg/4udtcA5


## Submission Guide

Thanks for contributing to the YAGPDB documentation! Please take a moment to review this document in order to make the
Expand Down Expand Up @@ -45,7 +44,7 @@ this process below.
In your local clone, install the required dependencies via NPM by running the following command:

```shellsession
$ npm install
npm install
```

This will ensure that you can fully build the documentation site locally, including the custom syntax highlighting we
Expand Down Expand Up @@ -117,15 +116,15 @@ In order to preview your changes locally, you will need to run a local instance
you have Node.js (and NPM) and Hugo installed, you can do so by running the following command:

```shellsession
$ npm run dev
npm run dev
```

This will run a local server on `http://localhost:1313` that will automatically update whenever you save a file, though
without our custom syntax highlighting. If you prefer to view the site as it would appear on production, run the
following commands instead:

```shellsession
$ npm run build && npm run preview
npm run build && npm run preview
```

This will build the site, execute the highlighting post-processor, and run a local server on `http://localhost:4173`.
Expand Down
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- Please describe the changes this pull request does and why it should be merged -->

**Terms**

- [ ] I have read and understood this project's [Contributing Guidelines](CONTRIBUTING.md)
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ Pages are written in Markdown with additional shortcodes provided by the Doks th
documentation](<(https://getdoks.org/docs/start-here/getting-started/)>) for a complete list of features.

If you are editing pages related to custom commands, note that codeblocks support a custom `yag` language for accurate
syntax highlighting—do not use `go`. However, this feature is only enabled in production builds for performance, so `npm run dev` will _not_ highlight `yag` codeblocks. Use `npm run build` followed by `npm run preview` instead if you need to verify
that code is highlighted correctly.
syntax highlighting—do not use `go`. However, this feature is only enabled in production builds for performance, so
`npm run dev` will _not_ highlight `yag` codeblocks. Use `npm run build` followed by `npm run preview` instead if you
need to verify that code is highlighted correctly.

> [!TIP]
> If you use VSCode, this project provides custom workspace snippets to insert callouts, which you can activate in
Expand Down
16 changes: 10 additions & 6 deletions content/discord.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
+++
type = "redirect"
target = "https://discord.gg/4udtcA5"
title = "Discord"
+++
---
type: redirect
target: 'https://discord.gg/4udtcA5'
title: 'Discord'
---

<!-- this file intentionally left blank -->
<!--
This file intentionally left blank.
We use YAML front matter here instead of the usual TOML just so markdownlint can properly lint for blank URLs in other
files without firing on this one.
-->
2 changes: 1 addition & 1 deletion content/docs/core/command-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Flags and switches are **_not_** affected by your prefix setting.

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

```
```txt
?wouldyourather -raw
```

Expand Down
16 changes: 8 additions & 8 deletions content/docs/custom-commands/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ You must specify a channel to run time-based commands in even if the command doe

A cron expression represents a set of times, using 5 space-separated fields.

Field name | Mandatory? | Allowed values | Allowed special characters
-------------- | ---------- | -------------- | --------------------------
Minutes | Yes | 0-59 | * / , -
Hours | Yes | 0-23 | * / , -
Day of month | Yes | 1-31 | * / , - ?
Month | Yes | 1-12 or JAN-DEC | * / , -
Day of week (DOW)| Yes | 0-6 or SUN-SAT | * / , - ?
| Field name | Mandatory? | Allowed values | Allowed special characters |
| -------------- | ---------- | -------------- | -------------------------- |
| Minutes | Yes | 0-59 | * / , - |
| Hours | Yes | 0-23 | * / , - |
| Day of month | Yes | 1-31 | * / , - ? |
| Month | Yes | 1-12 or JAN-DEC | * / , - |
| Day of week (DOW)| Yes | 0-6 or SUN-SAT | * / , - ? |

To read more about the supported format of cron expressions, visit [Robfig's Cron package documentation - Expression
Format](https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format).
Expand All @@ -302,7 +302,7 @@ on Corntab Guru, but are not supported with YAGPDB.

{{< /callout >}}

**Special Characters**
###### Special Characters

- Asterisk ( * )

Expand Down
1 change: 0 additions & 1 deletion content/docs/fun/soundboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Do **not** fill in the URL if you are going uploaded from local files, and vice

{{< /callout >}}


You have two options to upload sounds:

- Upload with local files
Expand Down
6 changes: 2 additions & 4 deletions content/docs/moderation/advanced-automoderator/triggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ This trigger will fire when a message matches the specified regular expression.[
- **Also match visually similar characters**<br>
Whether to also match visually similar characters, like `Ĥéĺĺó`. (Default: off)


#### Message not matching Regex

The inverse of [Message matches Regex](#message-matches-regex). See there for configuration.
Expand Down Expand Up @@ -305,12 +304,11 @@ This trigger will fire when a message triggers Discord's Automod.

<!-- footnotes -->

[^1]: The regular expression used to match links is the following:
<code>(?i)([a-z\d]+://)([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])</code>
[^1]: The regular expression used to match links is the following:<br>
``(?i)([a-z\d]+://)([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])``

[^2]: Under the hood, the bot will only check the last 1000 messages in the channel. If you have a high-traffic channel
in combination with an extremely long time frame, the bot could (theoretically) miss some messages.

[^3]: The RegEx engine used in YAGPDB is RE2. Some features are not supported, like lookaheads and lookbehinds. See
[regex101](https://regex101.com/?flavor=golang) for some help with writing RE2-compatible regular expressions.

19 changes: 13 additions & 6 deletions content/docs/moderation/moderation-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,30 @@ To remove the requirement and make the reason optional, you may toggle this on (

#### Moderation DMs

Moderation DMs are template scripts (**3**) which are executed within the offending user's DM. Text output to the response will
be directly sent to the offending user.
Moderation DMs are template scripts (**3**) which are executed within the offending user's DM. Text output to the
response will be directly sent to the offending user.

{{< link-card href="/docs/reference/templates/syntax-and-data" description="Templates Reference" target="_blank" >}}

Additional template dot context data is available for Moderation Actions:

- `{{.Reason}}`: The reason specified in the timeout.
- `{{.Author}}`: The author of the punishment, is a [user object](/docs/reference/templates/syntax-and-data#user).
- `{{.Duration}}`: The duration of the mod action as a [time.Duration format](/docs/reference/templates/syntax-and-data#time).
- `{{.Author}}`: The author of the punishment, is a [user object].
- `{{.Duration}}`: The duration of the mod action as a [time.Duration format].
- `{{.HumanDuration}}`: The duration in a human friendly format (`1 hour and 3 minutes` for example).
- `{{.WarningID}}`: The ID of the warning (when using the warn command).

[user object]: /docs/reference/templates/syntax-and-data#user
[time.Duration format]: /docs/reference/templates/syntax-and-data#time

{{< callout context="danger" title="Danger: Template Execution Errors" icon="outline/alert-octagon" >}}

Any errors which occur in the template execution will not be logged by default. The offending user will only receive a
DM from your server saying **Failed executing template.** Setting a [Moderation DM Error channel](#mod-channels) allows
for the more detailed errors to be captured.

{{< /callout >}}

Moderation actions which send DMs are:

- Timeout
Expand Down Expand Up @@ -273,8 +280,8 @@ You may optionally send warnings to the mod log, this is enabled in the warnings

[ClearWarnings Command Syntax](/docs/core/all-commands#clearwarnings) - Clears the warnings of a user.

[TopWarnings Command Syntax](/docs/core/all-commands#topwarnings) - Shows ranked list of warnings on the server, allowing you to turn
misbehavior into a fun minigame for your server members.
[TopWarnings Command Syntax](/docs/core/all-commands#topwarnings) - Shows ranked list of warnings on the server,
allowing you to turn misbehavior into a fun minigame for your server members.

{{< callout context="tip" title="Tip: Taking Action on Warn Count" icon="outline/rocket" >}}

Expand Down
1 change: 0 additions & 1 deletion content/docs/notifications/streaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ description = "Spam your server with notifications when someone starts streaming

Let everyone know that someone is currently streaming.


### Streaming Feed

{{< callout context="note" title="Note: Announcements may not Post" icon="outline/info-circle" >}}
Expand Down
17 changes: 8 additions & 9 deletions content/docs/notifications/youtube.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,17 @@ may need to scroll down a bit); then select a channel to post it to. For a visua

</center>


If you are unable to obtain a direct channel URL, similar to<br>
*https://youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw*, we also support the following URLs:
*<https://youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw>*, we also support the following URLs:

- Video links (https://youtube.com/watch?v=dQw4w9WgXcQ)
- Shorts links (https://youtube.com/shorts/pBZ_2pX_8mg)
- Share links (https://youtu.be/dQw4w9WgXcQ)
- Live links (https://youtube.com/live/jfKfPfyJRdk)
- Playlist links (https://youtube.com/playlist?list=PLEamUZtdyTMxwDNQ97Y7im8EwqRyht12R)
- Video links (<https://youtube.com/watch?v=dQw4w9WgXcQ>)
- Shorts links (<https://youtube.com/shorts/pBZ_2pX_8mg>)
- Share links (<https://youtu.be/dQw4w9WgXcQ>)
- Live links (<https://youtube.com/live/jfKfPfyJRdk>)
- Playlist links (<https://youtube.com/playlist?list=PLEamUZtdyTMxwDNQ97Y7im8EwqRyht12R>)

Although we make an attempt at extracting the channel from usernames (https://youtube.com/user/MontyPython),
custom links (https://youtube.com/c/Taskmaster), and handles (https://youtube.com/@TomScottGo), these are not as
Although we make an attempt at extracting the channel from usernames (<https://youtube.com/user/MontyPython>),
custom links (<https://youtube.com/c/Taskmaster>), and handles (<https://youtube.com/@TomScottGo>), these are not as
reliable as the links listed above, as we use the first result of a YouTube search to determine the channel via these
URLs.

Expand Down
2 changes: 1 addition & 1 deletion content/docs/reference/custom-command-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ You don't have any notes :(
{{end}}
```

### Cooldown Example&#x20;
### Cooldown Example

With YAGPDB's database system, you can now add cooldowns to you custom commands. You can either make them global
cooldowns or a per user cooldown.
Expand Down
114 changes: 59 additions & 55 deletions content/docs/reference/custom-commands-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,82 +6,86 @@ description = "Limits? I'm at my limit!"

Various limits in YAGPDB custom commands (CC) for smooth functioning of the bot and misuse prevention.

## OVERALL
## Overall

* **Max amount of CCs:** 100/250 (free/prem)
* **Max CCs that can be triggered by a single action:** 3/5 (free/prem)
* **Character limit:** 10k (5k for join/leave msg, warn dm, etc...)
* **Limit writer:** 25kB
* **Max operations:** 1M/2.5M (free/prem)
* **Response Character Limit:** 2k
* **Generic API based Action call limit:** 100 per CC
* **State Lock based Actions:** 500 per CC (mentionRoleName/ID ; hasRoleName ; targetHasRoleName/ID)
- **Max amount of CCs:** 100/250 (free/prem)
- **Max CCs that can be triggered by a single action:** 3/5 (free/prem)
- **Character limit:** 10k (5k for join/leave msg, warn dm, etc...)
- **Limit writer:** 25kB
- **Max operations:** 1M/2.5M (free/prem)
- **Response Character Limit:** 2k
- **Generic API based Action call limit:** 100 per CC
- **State Lock based Actions:** 500 per CC (mentionRoleName/ID ; hasRoleName ; targetHasRoleName/ID)

## CALLING A CC
## Calling a Custom Command

### execCC

* **Calls per CC:** 1/10 (free/prem) -> counter key "runcc"
* **StackDepth limit:** 2 (executing with 0 delay)
* **Delay limit:** int64 limit (292 years)
- **Calls per CC:** 1/10 (free/prem) -> counter key "runcc"
- **StackDepth limit:** 2 (executing with 0 delay)
- **Delay limit:** int64 limit (292 years)

### scheduleUniqueCC

* **Calls per CC:** 1/10 (free/prem) -> counter key "runcc"
* **Delay limit:** int64 limit (292 years)
* There can only be 1 per server per key
- **Calls per CC:** 1/10 (free/prem) -> counter key "runcc"
- **Delay limit:** int64 limit (292 years)
- There can only be 1 per server per key

### cancelScheduledUniqueCC

* **Calls per CC:** 10/10 (free/prem) -> counter key "cancelcc"

## CONTEXT

* **Max file size (complexMessage):** 100kB
* **joinStr max string length:** 1000kB
* **sendDM:** 1 call per CC -> counter key "send\_dm"
* **sendTemplate/sendTemplateDM:** 3 calls per CC -> counter key "exec\_child"
* **addReactions:** 20 calls per CC -> counter key "add\_reaction\_trigger". Each reaction added counts towards the limit.
* **addResponseReactions:** 20 calls per CC -> counter key "add\_reaction\_response". Each reaction added counts towards the limit.
* **addMessageReactions:** 20 calls per CC -> counter key "add\_reaction\_message". Each reaction added counts towards the limit.
* **deleteMessageReaction: 1**0 calls per CC -> counter key "del\_reaction\_message". Each removed added counts towards the limit.
* **editChannelName/Topic:** 10 calls per CC -> counter key "edit\_channel"
* **regex cache limit:** 10 (this means you cant have more than 10 different regexes on a CC)
* **onlineCount:** 1 call per cc -> counter key "online\_users"
* **onlineCountBots:** 1 call per cc -> counter key "online\_bots"
* **editNickname:** 2 calls per cc -> counter key "edit\_nick"
* **Append/AppendSlice limit:** 10k size limit of resulting slice
* **exec/execAdmin:** 5 calls per cc -> no key
* **deleteResponse/deleteMessage/deleteTrigger max delay:** 86400s
* **take/removeRoleID/Name max delay:** int64 limit (292 years)
* **sleep:** 60 seconds
- **Calls per CC:** 10/10 (free/prem) -> counter key "cancelcc"

## Context

- **Max file size (complexMessage):** 100kB
- **joinStr max string length:** 1000kB
- **sendDM:** 1 call per CC -> counter key "send\_dm"
- **sendTemplate/sendTemplateDM:** 3 calls per CC -> counter key "exec\_child"
- **addReactions:** 20 calls per CC -> counter key "add\_reaction\_trigger". Each reaction added counts towards the
limit.
- **addResponseReactions:** 20 calls per CC -> counter key "add\_reaction\_response". Each reaction added counts towards
the limit.
- **addMessageReactions:** 20 calls per CC -> counter key "add\_reaction\_message". Each reaction added counts towards
the limit.
- **deleteMessageReaction: 1**0 calls per CC -> counter key "del\_reaction\_message". Each removed added counts towards
the limit.
- **editChannelName/Topic:** 10 calls per CC -> counter key "edit\_channel"
- **regex cache limit:** 10 (this means you cant have more than 10 different regexes on a CC)
- **onlineCount:** 1 call per cc -> counter key "online\_users"
- **onlineCountBots:** 1 call per cc -> counter key "online\_bots"
- **editNickname:** 2 calls per cc -> counter key "edit\_nick"
- **Append/AppendSlice limit:** 10k size limit of resulting slice
- **exec/execAdmin:** 5 calls per cc -> no key
- **deleteResponse/deleteMessage/deleteTrigger max delay:** 86400s
- **take/removeRoleID/Name max delay:** int64 limit (292 years)
- **sleep:** 60 seconds

## DATABASE

### Overall Limits

* **Max amount of DBs:** Membercount \*50\*1/10(free/prem)
* **Key length limit:** 256
* **Expire limit:** int64 limit (292 years)
* **Value size limit:** 100kB
- **Max amount of DBs:** Membercount \*50\*1/10(free/prem)
- **Key length limit:** 256
- **Expire limit:** int64 limit (292 years)
- **Value size limit:** 100kB

### Database Interactions

* **Calls per CC:** 10/50 (free/prem) -> counter key "db\_interactions"
* Valid for all database commands ->
* dbDel/dbDelByID
* dbGet
* dbIncr
* dbSet/dbSetExpire
- **Calls per CC:** 10/50 (free/prem) -> counter key "db\_interactions"
- Valid for all database commands ->
- dbDel/dbDelByID
- dbGet
- dbIncr
- dbSet/dbSetExpire

### Database Multiple Entry Interactions

Multiple entries all count to general "db\_interactions" limit as well.

* **Calls per CC:** 2/10 (free/prem) -> counter key "db\_multiple"
* Valid for all database multiple entry related commands ->
* dbCount
* dbDelMultiple
* dbGetPattern
* dbRank
* dbTopEntries
- **Calls per CC:** 2/10 (free/prem) -> counter key "db\_multiple"
- Valid for all database multiple entry related commands ->
- dbCount
- dbDelMultiple
- dbGetPattern
- dbRank
- dbTopEntries
Loading

0 comments on commit a52f746

Please sign in to comment.