Token and bad code#500
Merged
Merged
Conversation
Added a new function `is_token_in_message` in `token_remover`. This function returns a `bool` and if the code contains a token then the embed message about the poorly formatted code is not displayed.
After a new bunch of test I found bugs, and this fix resolves them
fix linting error
jchristgit
requested changes
Oct 11, 2019
jchristgit
previously requested changes
Oct 14, 2019
Contributor
jchristgit
left a comment
There was a problem hiding this comment.
One more thing. Aside from that LGTM
sco1
previously requested changes
Oct 14, 2019
Contributor
sco1
left a comment
There was a problem hiding this comment.
The same checks need to be present for message edits as well.
Contributor
Author
|
@sco1 Hi, I am sorry but I am not sure about what you mean. Do you say the bot should also checks if a message contains a token every time a message is edited? |
Contributor
|
Yes |
Contributor
Contributor
Author
|
Pretty busy right now, will do it as soon as I can. |
Contributor
Author
|
Not sure about using a |
Contributor
Author
|
In case it is not clear, I changed my code to respond to the requested changes. |
tagptroll1
reviewed
Nov 25, 2019
Contributor
tagptroll1
left a comment
There was a problem hiding this comment.
Looks good, just a small comment.
Include the check about whether or not there is a token in the posted message in `parse_codeblock` boolean.
MarkKoz
approved these changes
Dec 12, 2019
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fix #389
Split the
token_removerin two functions, one that checks that there is a token in the message (is_token_in_message), and the other takes the actions (deleting the message, etc.)This new function
is_token_in_messageis reused incogs/bot.pyto know if the poorly formatted code contains a token. If it true, then the embed message is not displayed, sincetoken_remover.pyis already in charge.