From 9a3040cf203539489737acd15282d526c110c4ea Mon Sep 17 00:00:00 2001 From: DevilXD Date: Sun, 19 May 2019 02:00:00 +0200 Subject: [PATCH] Added support for 'py' as the code block type (#47) People (me included) often use the shorter version of defining python usage within a code block on discord: `py`. This small change should add support for it, the following is also considered a Python code in Discord: ```py print("Hello world!") ``` Note: Noticed while checking out the code and wanted to help by improving it, didn't test this change but it should work. --- coglint/coglint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coglint/coglint.py b/coglint/coglint.py index 2a802fe..37f129f 100644 --- a/coglint/coglint.py +++ b/coglint/coglint.py @@ -75,7 +75,7 @@ class CogLint(Cog): for c in code_blocks: is_python, code = c.split(None, 1) - is_python = is_python.lower() == "python" + is_python = is_python.lower() in ["python", "py"] if is_python: # Then we're in business linted, errors = await self.lint_code(code) linted = linted.getvalue()