aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2020-06-13Code block: add function to find invalid code blocksGravatar MarkKoz-2/+32
* Create a `NamedTuple` representing a code block
2020-06-13Code block: add regex to search for any code blocksGravatar MarkKoz-12/+25
This regex supports both valid and invalid ticks. The ticks are in a group so it's later possible to detect if valid ones were used.
2020-06-13Code block: fix code block language regexGravatar MarkKoz-1/+1
It was missing a quantifier to match more than 1 character.
2020-06-13Code block: use a more efficient line count checkGravatar MarkKoz-57/+59
2020-06-13Code block: ignore if code block has *any* languageGravatar MarkKoz-5/+3
If the code was valid Python syntax, the guide embed would be sent despite a non-Python language being explicitly specified for the code block by the message author. * Make the code block language regex a compiled pattern constant Fixes #829
2020-06-13Code block: simplify log messageGravatar MarkKoz-3/+2
2020-06-13Code block: make invalid backticks a constant setGravatar MarkKoz-9/+16
A set should be faster since it's being used to test for membership. A constant just means it won't need to be redefined every time the function is called. * Make `has_bad_ticks` a static method * Add comments describing characters represented by the Unicode escapes
2020-06-13Code block: move standard guide message creation to a new functionGravatar MarkKoz-50/+55
* Rename `howto` variable to `description`
2020-06-13Code block: move bad ticks message creation to a new functionGravatar MarkKoz-33/+37
2020-06-13Code block: move final send/cooldown code outside the try-exceptGravatar MarkKoz-9/+6
Reduces nesting for improved readability. The code would have never thrown a syntax error in the manner expected anyway.
2020-06-13Code block: add helper function to send the embedGravatar MarkKoz-7/+15
2020-06-13Code block: invert conditions to reduce nestingGravatar MarkKoz-102/+107
2020-06-13Code block: add helper function to check for channel cooldownGravatar MarkKoz-2/+9
2020-06-13Code block: add helper function to check if msg should be parsedGravatar MarkKoz-8/+19
* Check for bot author first because it's a simpler/faster check
2020-06-13Code block: add helper function to check channel is validGravatar MarkKoz-5/+9
2020-06-13Code block: add helper function to check for help channelsGravatar MarkKoz-5/+10
2020-06-13Move code block formatting detection to a separate extension/cogGravatar MarkKoz-321/+342
It was really out of place in the BotCog, which is meant more for general, simple utility commands.
2020-06-12Escape markdown in charinfo embedGravatar MarkKoz-2/+2
The embed displays the original character. If it's a markdown char, it would interfere with the embed's actual markdown. The backtick was especially troublesome. Fixes #996
2020-06-11Replace mention of Flask with DjangoGravatar Mark-1/+1
The site's description still stated that it was built with Flask, which is no longer accurate due to the move to Django.
2020-06-11Add cooldown to Channels in constants.pyGravatar Joseph Banks-0/+1
2020-06-11Add cooldown channel to EXCLUDED_CHANNELS tupleGravatar Joseph Banks-1/+1
2020-06-11Add cooldown channel to config-default.ymlGravatar Joseph Banks-0/+1
2020-06-11Fix trailing whitespace in Action fileGravatar Joseph Banks-1/+1