aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-08-23 10:17:24 -0700
committerGravatar MarkKoz <[email protected]>2020-08-23 10:17:24 -0700
commit7c97e1954503185d41ddf3cdc9c9b5b64bbb0a46 (patch)
treee7842ab19c1f8fd0d7fcc3332d88445160f45b1e
parentHelpChannels: fix conflict with pin functions (diff)
Code block: clarify that the original message can be edited
Fix #497
-rw-r--r--bot/cogs/codeblock/instructions.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/bot/cogs/codeblock/instructions.py b/bot/cogs/codeblock/instructions.py
index 56b85a34f..84c7a5ea0 100644
--- a/bot/cogs/codeblock/instructions.py
+++ b/bot/cogs/codeblock/instructions.py
@@ -161,21 +161,24 @@ def get_instructions(content: str) -> Optional[str]:
if not blocks:
log.trace("No code blocks were found in message.")
- return _get_no_ticks_message(content)
+ instructions = _get_no_ticks_message(content)
else:
log.trace("Searching results for a code block with invalid ticks.")
block = next((block for block in blocks if block.tick != parsing.BACKTICK), None)
if block:
log.trace("A code block exists but has invalid ticks.")
- return _get_bad_ticks_message(block)
+ instructions = _get_bad_ticks_message(block)
else:
log.trace("A code block exists but is missing a language.")
block = blocks[0]
# Check for a bad language first to avoid parsing content into an AST.
- description = _get_bad_lang_message(block.content)
- if not description:
- description = _get_no_lang_message(block.content)
+ instructions = _get_bad_lang_message(block.content)
+ if not instructions:
+ instructions = _get_no_lang_message(block.content)
- return description
+ if instructions:
+ instructions += "\nYou can **edit your original message** to correct your code block."
+
+ return instructions