aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| * | | | Fix E128 linting errorGravatar Akarys422019-09-23-4/+4
| | | | |
| * | | | Merge branch 'python-discord-master'Gravatar Akarys422019-09-23-4931/+5537
| |\ \ \ \
| | * | | | Merge branch 'master' of https://github.com/python-discord/bot into ↵Gravatar Akarys422019-09-23-4931/+5537
| |/| | | | | | | | | | | | | | | | | | | | | | python-discord-master
| * | | | | Change log.error to log.exceptionGravatar Akarys422019-09-22-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | See issue #382
| | | * | | Prevent false-positives of the rich embed filterGravatar Sebastiaan Zeeff2019-09-24-15/+33
| |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/python-discord/bot/issues/293 The rich embed filter is plagued by false positives now Discord has added more custom preview embeds for various websites. Since these embeds have the `rich` type instead of the `link` type, these embeds triggered the filter we had in place. This commit remedies that by using the existing URL regex pattern to list all the URLs contained in the message content and then checking if the embed url is a member of that list. If so, it's very likely that the embed was auto-generated from that URL, so we should ignore it. This approach deviates slightly from that outlined in #293. This does increase the probability of a false-negative, as a "true" user-generated rich embed could also have a url that's contained in the message body. However, I've checked most of the triggers we have had in the past and none of the legitimate triggers would have been a false-negative under the new rules. Therefore, I think it's very reasonable to adopt this strategy. In addition to the change in behavior of the rich embed filter, I have also kaizened the existing regex patterns by compiling them at load time. Since we check a lot of regex patterns for every message received by the bot, this should be beneficial for performance.
| | | * | Remove repeat logic for off-topic-name api callGravatar Sebastiaan Zeeff2019-09-24-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a short discussion in the core-dev team, we decided to not use retry logic for a failed API call for new off-topic-names. We may introduce something similar in the future, but we're not sure on the direction we want to take yet.
| | | * | Put import in alphabetical orderGravatar Matteo Bertucci2019-09-24-1/+1
| | | | |
| | | * | Override waiting time to half an hour Gravatar Matteo Bertucci2019-09-24-1/+6
| | | | | | | | | | | | | | | If an exception occurred
| | | * | Fix importing errorGravatar Matteo Bertucci2019-09-24-1/+2
| | | | | | | | | | | | | | | `bot.api.ResponseCodeError` is now imported
| | | * | Merge branch 'master' into ot-fixGravatar Matteo Bertucci2019-09-24-90/+169
| | | |\ \ | |_|_|/ / |/| | | |
* | | | | Merge pull request #449 from python-discord/duration-converter-fixGravatar Sebastiaan Zeeff2019-09-24-90/+169
|\ \ \ \ \ | |_|/ / / |/| | | | Fix failing duration conversion
| * | | | Restructure Duration converter docstringGravatar Sebastiaan Zeeff2019-09-23-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | In this commit, I've restructured the Duration converter's docstring to a more readable format: a bullet point list.
| * | | | Allow whitespace in duration strings and update testsGravatar Sebastiaan Zeeff2019-09-23-123/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/python-discord/bot/issues/446 After review feedback and a discussion in the dev-core team, I've changed a couple of things: - Allow a space between amount and unit in the duration string; - Allow a space between different units in the duration string; - Remove the old ExpirationDate converter completely; - Remove the dependency `dateparser` from the Pipfile; - Update tests for the two types of optional spaces; - Change the test for valid cases to a more readable format; This PR closes #446
| * | | | Fix failing duration conversionGravatar Sebastiaan Zeeff2019-09-23-18/+127
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/python-discord/bot/issues/446 The current ExpirationDate converter does not convert duration strings to `datetime.datetime` objects correctly. To remedy the problem, I've written a new Duration converter that uses regex matching to extract the relevant duration units and `dateutil.relativedelta.relativedelta` to compute a `datetime.datetime` that's the given duration in the future. I've left the old `ExpirationDate` converter in place for now, since the new Duration converter may not be the most optimal method. However, given the importance of being able to convert durations for moderation tasks, I think it's better to implement Duration now and rethink the approach later. This commit closes #446
| | * | Add `continue` in the except blockGravatar Matteo Bertucci2019-09-24-0/+1
| | | |
| | * | Catch error in case of non successfull API call for new ot-namesGravatar Akarys422019-09-23-3/+6
| |/ / |/| | | | | | | | This allows to keep the task running even if the call fail.
* | | Make DEFCON days subcommand enable DEFCON (#405)Gravatar scragly2019-09-23-66/+70
|\ \ \ | | | | | | | | | | | | | | | | | | | | Make DEFCON days subcommand enable DEFCON Co-authored-by: Joseph <[email protected]> Co-authored-by: null <[email protected]>
| * \ \ Merge branch 'master' into defcon-fix-djangoGravatar scragly2019-09-23-1708/+1066
| |\ \ \ | |/ / / |/| | |
* | | | Update linting (#406)Gravatar scragly2019-09-23-1708/+1066
|\ \ \ \ | |_|_|/ |/| | | Update linting
| * | | Apply suggestions from code reviewGravatar sco12019-09-22-235/+156
| | | | | | | | | | | | | | | | Co-Authored-By: Mark <[email protected]>
| * | | Apply suggestions from code reviewGravatar S. Co12019-09-22-29/+39
| | | | | | | | | | | | Co-Authored-By: Mark <[email protected]>
| * | | Merge branch 'master' into flake8-pluginsGravatar sco12019-09-22-3/+3
| |\ \ \ | |/ / / |/| | |
| * | | Apply suggestions from code reviewGravatar S. Co12019-09-22-3/+3
| | | | | | | | | | | | Co-Authored-By: Leon Sandøy <[email protected]>
| * | | Apply suggestions from code reviewGravatar sco12019-09-19-2/+2
| | | | | | | | | | | | | | | | Co-Authored-By: Sebastiaan Zeeff <[email protected]>
| * | | Apply suggestions from code reviewGravatar S. Co12019-09-19-4/+4
| | | | | | | | | | | | Co-Authored-By: Sebastiaan Zeeff <[email protected]>
| * | | Update imports for applied code review suggestionsGravatar sco12019-09-19-4/+3
| | | |
| * | | Apply suggestions from code reviewGravatar S. Co12019-09-19-13/+13
| | | | | | | | | | | | Co-Authored-By: Sebastiaan Zeeff <[email protected]>
| * | | Replace incorrect None returns with Optional in certain commandsGravatar sco12019-09-19-17/+24
| | | |
| * | | Use Optional typing shorthand rather than Union w/NoneGravatar sco12019-09-19-6/+6
| | | |
| * | | Update paginator defs for correct Optional returnGravatar sco12019-09-19-9/+13
| | | | | | | | | | | | | | | | Co-Authored-By: Sebastiaan Zeeff <[email protected]>
| * | | Apply suggestions from code review Gravatar S. Co12019-09-19-6/+6
| | | | | | | | | | | | | | | | | | | | Fix decorator return hints Co-Authored-By: Sebastiaan Zeeff <[email protected]>
| * | | Merge branch 'master' into flake8-pluginsGravatar sco12019-09-18-5/+55
| |\ \ \
| * \ \ \ Merge branch 'master' into flake8-pluginsGravatar sco12019-09-18-807/+1763
| |\ \ \ \
| * | | | | Docstring linting chunk 7Gravatar sco12019-09-10-155/+96
| | | | | | | | | | | | | | | | | | | | | | | | Whew
| * | | | | Docstring linting chunk 6Gravatar sco12019-09-10-357/+187
| | | | | |
| * | | | | Docstring linting chunk 5Gravatar sco12019-09-10-93/+68
| | | | | |
| * | | | | Docstring linting chunk 4Gravatar sco12019-09-10-176/+125
| | | | | |
| * | | | | Docstring linting chunk 3Gravatar sco12019-09-10-313/+170
| | | | | |
| * | | | | Docstring linting chunk 2Gravatar sco12019-09-10-285/+150
| | | | | |
| * | | | | Docstring linting chunk 1Gravatar sco12019-09-09-141/+114
| | | | | |
| * | | | | Update linting dependencies & rulesGravatar sco12019-09-09-11/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add flake8-annotations * Add flake8-docstrings
| | | | * | Return the message to sendGravatar Joseph Banks2019-09-22-0/+2
| | | | | |
| | | | * | Merge branch 'master' into defcon-fix-djangoGravatar sco12019-09-22-806/+1828
| | | | |\ \ | |_|_|_|/ / |/| | | | |
* | | | | | Fix date formatting bug in infraction searchGravatar Sebastiaan Zeeff2019-09-19-2/+2
| |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The infraction search feature did not work because of a small bug with the date formatting: `datetime.fromisoformat` does not like the Z at the end of the datestring the database sends back, so we need to chop it off. I've applied the same method for doing that as already in use in other parts of the bot codebase.
* | | | | Add tests for `bot.rules.attachments`. (#426)Gravatar scragly2019-09-19-2/+54
|\ \ \ \ \ | | | | | | | | | | | | Add tests for `bot.rules.attachments`.
| * | | | | Add tests for `bot.rules.attachments`.Gravatar Johannes Christ2019-09-18-2/+54
|/ / / / / | | | | | | | | | | | | | | | This also fixes an issue with the `attachments` rule not respecting the most recent message sent by a user.
* | | | | Merge pull request #438 from python-discord/hemlock-infraction-date-humanizationGravatar Mark2019-09-18-2/+7
|\ \ \ \ \ | | | | | | | | | | | | Infraction Search Dates
| * | | | | Infraction Date HumanizationGravatar Daniel Brown2019-09-18-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Corrected an error that would have made the code bug out. Moved a closing parentheses to the correct spot. Signed-off-by: Daniel Brown <[email protected]>
| * | | | | Merge branch 'master' into hemlock-infraction-date-humanizationGravatar Daniel Brown2019-09-18-0/+195
| |\ \ \ \ \ | |/ / / / / |/| | | | |
* | | | | | Merge pull request #431 from python-discord/bot-cogs-information-testsGravatar Johannes Christ2019-09-18-0/+195
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add basic tests for `bot.cogs.information`.