@@ -37,9 +37,8 @@ def _get_bad_ticks_message(code_block: _parsing.CodeBlock) -> str | None:
37
37
38
38
valid_ticks = f"\\ { _parsing .BACKTICK } " * 3
39
39
instructions = (
40
- "It looks like you are trying to paste code into this channel.\n \n "
41
- "You seem to be using the wrong symbols to indicate where the code block should start. "
42
- f"The correct symbols would be { valid_ticks } , not `{ code_block .tick * 3 } `."
40
+ "You are using the wrong character instead of backticks. "
41
+ f"Use { valid_ticks } , not `{ code_block .tick * 3 } `."
43
42
)
44
43
45
44
log .trace ("Check if the bad ticks code block also has issues with the language specifier." )
@@ -59,8 +58,6 @@ def _get_bad_ticks_message(code_block: _parsing.CodeBlock) -> str | None:
59
58
instructions += "\n \n Furthermore, " + addition_msg [0 ].lower () + addition_msg [1 :]
60
59
else :
61
60
log .trace ("No issues with the language specifier found." )
62
- example_blocks = _get_example (code_block .language )
63
- instructions += f"\n \n **Here is an example of how it should look:**\n { example_blocks } "
64
61
65
62
return instructions
66
63
@@ -71,13 +68,7 @@ def _get_no_ticks_message(content: str) -> str | None:
71
68
72
69
if _parsing .is_python_code (content ):
73
70
example_blocks = _get_example ("py" )
74
- return (
75
- "It looks like you're trying to paste code into this channel.\n \n "
76
- "Discord has support for Markdown, which allows you to post code with full "
77
- "syntax highlighting. Please use these whenever you paste code, as this "
78
- "helps improve the legibility and makes it easier for us to help you.\n \n "
79
- f"**To do this, use the following method:**\n { example_blocks } "
80
- )
71
+ return example_blocks
81
72
log .trace ("Aborting missing code block instructions: content is not Python code." )
82
73
return None
83
74
@@ -135,12 +126,8 @@ def _get_no_lang_message(content: str) -> str | None:
135
126
example_blocks = _get_example ("py" )
136
127
137
128
# Note that _get_bad_ticks_message expects the first line to have two newlines.
138
- return (
139
- "It looks like you pasted Python code without syntax highlighting.\n \n "
140
- "Please use syntax highlighting to improve the legibility of your code and make "
141
- "it easier for us to help you.\n \n "
142
- f"**To do this, use the following method:**\n { example_blocks } "
143
- )
129
+ return f"Please add a `py` after the three backticks.\n \n { example_blocks } "
130
+
144
131
log .trace ("Aborting missing language instructions: content is not Python code." )
145
132
return None
146
133
@@ -177,7 +164,4 @@ def get_instructions(content: str) -> str | None:
177
164
if not instructions :
178
165
instructions = _get_no_lang_message (block .content )
179
166
180
- if instructions :
181
- instructions += "\n You can **edit your original message** to correct your code block."
182
-
183
167
return instructions
0 commit comments