Skip to content
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
17 changes: 10 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ name: Lint

on:
pull_request:
paths:
- 'content/**/*.md'

jobs:
lint-markdown:
markdown:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Lint markdown files
uses: actionshub/markdownlint@main
uses: DavidAnson/markdownlint-cli2-action@v19
continue-on-error: true
with:
filesToIgnoreRegex: 'all-commands.md|scripts/.*|.github/.*'
globs: |
content/**/*.md
!content/docs/core/all-commands.md
config: config/.markdownlint.yaml
3 changes: 0 additions & 3 deletions .mdlrc

This file was deleted.

64 changes: 53 additions & 11 deletions config/markdownlint.rb → config/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,91 @@
# Enable all rules; we'll configure some of them below.
all
default: true

# MD001: Header levels should only increment by one level at a time.
# Normally, this is a fair rule, but it does not quite work for our cases,
# especially in our humongous functions list. So disable it.
exclude_rule 'MD001'
MD001: false

# MD002: First header should be a top level header.
# Some files do not have a top-level header, because it doesn't make sense for
# them, or just looks incredibly stupid on the rendered page. So disable this
# entire rule.
exclude_rule 'MD002'
MD002: false

# MD004: Unordered list style.
# Use dashes for unordered lists. All lists. Even sublists.
rule 'MD004', :style => :dash
MD004:
style: "dash"

# MD013: Line length.
# Allow lines to be up to 120 characters long, see the .editorconfig file.
# We also ignore code blocks, because they are often long and should not be
# wrapped at all. Same goes for tables.
rule 'MD013', :line_length => 120, :ignore_code_blocks => true, :tables => false
MD013:
line_length: 120
code_blocks: false
tables: false

# MD024: Multiple headers with the same content.
# Allow multiple headers with the same content so long they are under different
# parent headers.
rule 'MD024', :allow_different_nesting => true
MD024:
siblings_only: true

# MD026: Trailling punctuation in header.
# Allow question marks (FAQ-style).
rule 'MD026', :punctuation => '.,;:!'
MD026:
punctuation: ".,;:!"

# MD029: Ordered list item prefix.
# Should increase in numerical order.
rule 'MD029', :style => :ordered
MD029:
style: "ordered"

# MD033: Inline HTML.
# Allow certain HTML elements, because we use them for nicer page layout.
rule 'MD033', :allowed_elements => 'center, div, sup, br, kbd'
MD033:
allowed_elements: ["center", "div", "sup", "br", "kbd"]

# MD037: Spaces inside emphasis markers.
# This rule is broken. See https://github.com/markdownlint/markdownlint/issues/84
exclude_rule 'MD037'
MD037: false

# MD041: First line in file should be a top-level header.
# See comment to MD002. It makes no sense to set this to H2 for similar reasons,
# we have TOML frontmatter with an automatic h1 in the rendered page.
exclude_rule 'MD041'
MD041: false

# MD048: Code fence style.
# Use backticks for code fences.
MD048:
style: "backtick"

# MD049: Emphasis style. (Italics)
# Use asterisks for italics.
# MD049:
# style: "asterisk"
# FIXME: Re-enable this rule once we have fixed all the italics in the docs.
MD049: false

# MD050: Strong style.
# Use double asterisks for bold text.
MD050:
style: "asterisk"

# MD051: Link fragments should be valid.
# Disable this rule, because Hugo already checks for (potentially) broken links.
MD051: false

# MD052: Reference links and images should use a label that is defined.
# Similar reasons as MD051, Hugo already checks for broken links.
MD052: false

# MD053: Link and image reference definitions should be needed.
# Similar reasons as MD051, Hugo already checks for broken links.
MD053: false

# MD054: Link and image style.
# Disable this rule, because it is very extensive and thus painful to configure.
# By extension, also very painful to fix.
MD054: false
44 changes: 22 additions & 22 deletions content/docs/reference/custom-commands-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ Various limits in YAGPDB custom commands (CC) for smooth functioning of the bot

- **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
- **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
- **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
- **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
- **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"
- **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"
- **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
Expand All @@ -71,21 +71,21 @@ Various limits in YAGPDB custom commands (CC) for smooth functioning of the bot

### Database Interactions

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

### Database Multiple Entry Interactions

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

- **Calls per CC:** 2/10 (free/prem) -> counter key "db\_multiple"
- **Calls per CC:** 2/10 (free/prem) -> counter key "db_multiple"
- Valid for all database multiple entry related commands ->
- dbCount
- dbDelMultiple
- dbGetPattern
- dbRank
- dbTopEntries
- dbCount
- dbDelMultiple
- dbGetPattern
- dbRank
- dbTopEntries
38 changes: 19 additions & 19 deletions content/docs/reference/custom-interactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -663,12 +663,12 @@ well.
Possible initial responses:

- Output text in your script response field. This text will be sent as an interaction response.
- You can even use the `ephemeralResponse` function to turn it _ephemeral_.
- You can even use the `ephemeralResponse` function to turn it _ephemeral_.
- Use the `sendResponse` function to send a response as soon as the function runs.
- You can also use this to send `embeds` or `complexMessages`.
- You'll need to send a `complexMessage` and pass it `"ephemeral" true` as an argument to send _ephemeral_ messages.
- `sendResponse` comes in `NoEscape` and `RetID` variants too.
- When sending an initial response, `sendResponse` does not need an interaction token, `nil` can be used.
- You can also use this to send `embeds` or `complexMessages`.
- You'll need to send a `complexMessage` and pass it `"ephemeral" true` as an argument to send _ephemeral_ messages.
- `sendResponse` comes in `NoEscape` and `RetID` variants too.
- When sending an initial response, `sendResponse` does not need an interaction token, `nil` can be used.
- Use the `sendModal` function to show the user a modal. You cannot respond to a user submitting a modal by sending them
another modal.
- Use the `updateMessage` function to edit the message the command triggered from. This works the same way as editing a
Expand All @@ -686,24 +686,24 @@ interaction token of the interaction they should be following up on.
Possible followups:

- Output text in your script response field. This text will be sent as an interaction followup.
- You can even use the `ephemeralResponse` function to turn it _ephemeral_.
- You can even use the `ephemeralResponse` function to turn it _ephemeral_.
- Use the `sendResponse` function to send a followup as soon as the function runs. Note that this function morphs into
sending followups if an initial response has already been made.
- You can also use this to send `embeds` or `complexMessages`.
- `sendResponse` comes in `NoEscape` and `RetID` variants too.
- It's important to capture the message ID of any
followups you'll want to edit or retrieve later, especially if you follow up ephemerally. If you follow up
ephemerally without saving the message ID, you'll never be able to interface with that message again.
- You can also use this to send `embeds` or `complexMessages`.
- `sendResponse` comes in `NoEscape` and `RetID` variants too.
- It's important to capture the message ID of any
followups you'll want to edit or retrieve later, especially if you follow up ephemerally. If you follow up
ephemerally without saving the message ID, you'll never be able to interface with that message again.
- Use the `editResponse` function to edit an initial response or a followup message.
- When editing an initial response, the `messageID` argument should be `nil`.
- When editing a followup message, the `messageID` argument is required.
- You can still edit any initial responses or followups using the standard `editMessage` function as long as they
aren't _ephemeral_.
- When editing an initial response, the `messageID` argument should be `nil`.
- When editing a followup message, the `messageID` argument is required.
- You can still edit any initial responses or followups using the standard `editMessage` function as long as they
aren't _ephemeral_.
- Use the `getResponse` function to get an initial response or a followup message.
- When getting an initial response, the `messageID` argument should be `nil`.
- When getting a followup message, the `messageID` argument is required.
- You can still get any initial responses or followups using the standard `getMessage` function as long as they
aren't _ephemeral_.
- When getting an initial response, the `messageID` argument should be `nil`.
- When getting a followup message, the `messageID` argument is required.
- You can still get any initial responses or followups using the standard `getMessage` function as long as they
aren't _ephemeral_.

[Interaction Function documentation](/docs/reference/templates/functions#interactions)

Expand Down
Loading