aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Andi Qu <[email protected]>2020-12-08 10:37:03 +0200
committerGravatar Andi Qu <[email protected]>2020-12-08 10:37:03 +0200
commitacd33d25f918cacb7eba6560578bda1585989cb3 (patch)
tree79c100e5c58623271fe3632698718327480436ae
parentAdd logging for HTTP requests (diff)
parentMerge branch 'master' into master (diff)
Merge branch 'master' of https://github.com/dolphingarlic/bot
-rw-r--r--bot/exts/filters/filtering.py2
-rw-r--r--bot/exts/info/code_snippets.py3
-rw-r--r--bot/resources/tags/codeblock.md16
3 files changed, 5 insertions, 16 deletions
diff --git a/bot/exts/filters/filtering.py b/bot/exts/filters/filtering.py
index 92cdfb8f5..208fc9e1f 100644
--- a/bot/exts/filters/filtering.py
+++ b/bot/exts/filters/filtering.py
@@ -246,7 +246,7 @@ class Filtering(Cog):
filter_triggered = True
stats = self._add_stats(filter_name, match, result)
- await self._send_log(filter_name, _filter["type"], msg, stats, is_eval=True)
+ await self._send_log(filter_name, _filter, msg, stats, is_eval=True)
break # We don't want multiple filters to trigger
diff --git a/bot/exts/info/code_snippets.py b/bot/exts/info/code_snippets.py
index e1025e568..669a21c7d 100644
--- a/bot/exts/info/code_snippets.py
+++ b/bot/exts/info/code_snippets.py
@@ -54,8 +54,7 @@ class CodeSnippets(Cog):
def _find_ref(self, path: str, refs: tuple) -> tuple:
"""Loops through all branches and tags to find the required ref."""
# Base case: there is no slash in the branch name
- ref = path.split('/')[0]
- file_path = '/'.join(path.split('/')[1:])
+ ref, file_path = path.split('/', 1)
# In case there are slashes in the branch name, we loop through all branches and tags
for possible_ref in refs:
if path.startswith(possible_ref['name'] + '/'):
diff --git a/bot/resources/tags/codeblock.md b/bot/resources/tags/codeblock.md
index a28ae397b..8d48bdf06 100644
--- a/bot/resources/tags/codeblock.md
+++ b/bot/resources/tags/codeblock.md
@@ -1,17 +1,7 @@
-Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
+Here's how to format Python code on Discord:
-To do this, use the following method:
-
-\```python
+\```py
print('Hello world!')
\```
-Note:
-• **These are backticks, not quotes.** Backticks can usually be found on the tilde key.
-• You can also use py as the language instead of python
-• The language must be on the first line next to the backticks with **no** space between them
-
-This will result in the following:
-```py
-print('Hello world!')
-```
+**These are backticks, not quotes.** Check [this](https://superuser.com/questions/254076/how-do-i-type-the-tick-and-backtick-characters-on-windows/254077#254077) out if you can't find the backtick key.