diff options
| author | 2020-05-08 17:43:21 -0700 | |
|---|---|---|
| committer | 2020-06-13 11:22:05 -0700 | |
| commit | 99a1734e8c6ace3e7a6418882f8dae40a3877534 (patch) | |
| tree | 996f3f6628ccf792e222ea24ae8dad0ec0e2c111 /bot/cogs/codeblock/parsing.py | |
| parent | Create a utility function to count lines in a string (diff) | |
Code block: add configurable variables
Diffstat (limited to '')
| -rw-r--r-- | bot/cogs/codeblock/parsing.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/cogs/codeblock/parsing.py b/bot/cogs/codeblock/parsing.py index 332a1deb0..89f8111fc 100644 --- a/bot/cogs/codeblock/parsing.py +++ b/bot/cogs/codeblock/parsing.py @@ -5,6 +5,7 @@ import logging import re from typing import NamedTuple, Optional, Sequence +from bot import constants from bot.utils import has_lines log = logging.getLogger(__name__) @@ -84,7 +85,7 @@ def find_code_blocks(message: str) -> Optional[Sequence[CodeBlock]]: if groups["tick"] == BACKTICK and language: log.trace("Message has a valid code block with a language; returning None.") return None - elif has_lines(groups["code"], 4): + elif has_lines(groups["code"], constants.CodeBlock.minimum_lines): code_block = CodeBlock(groups["code"], language, groups["tick"]) code_blocks.append(code_block) else: |