| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| |
| |
| |
| | |
Make DEFCON days subcommand enable DEFCON
Co-authored-by: Joseph <[email protected]>
Co-authored-by: null <[email protected]>
|
| |\
| |/
|/| |
|
|\ \
| | |
| | | |
Update linting
|
| | |
| | |
| | |
| | | |
Co-Authored-By: Mark <[email protected]>
|
| | |
| | |
| | | |
Co-Authored-By: Mark <[email protected]>
|
| |\ \
| |/ /
|/| | |
|
| | |
| | |
| | | |
Co-Authored-By: Leon Sandøy <[email protected]>
|
| | |
| | |
| | |
| | | |
Co-Authored-By: Sebastiaan Zeeff <[email protected]>
|
| | |
| | |
| | | |
Co-Authored-By: Sebastiaan Zeeff <[email protected]>
|
| | | |
|
| | |
| | |
| | | |
Co-Authored-By: Sebastiaan Zeeff <[email protected]>
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Co-Authored-By: Sebastiaan Zeeff <[email protected]>
|
| | |
| | |
| | |
| | |
| | | |
Fix decorator return hints
Co-Authored-By: Sebastiaan Zeeff <[email protected]>
|
| |\ \ |
|
| |\ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | | |
Whew
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* Add flake8-annotations
* Add flake8-docstrings
|
| | | | | |
|
| | | | |\
| |_|_|_|/
|/| | | | |
|
| |_|/ /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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`.
|
|/ / / /
| | | |
| | | |
| | | | |
This also fixes an issue with the `attachments` rule not respecting the most recent message sent by a user.
|
|\ \ \ \
| | | | |
| | | | | |
Infraction Search Dates
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- 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]>
|
| |\ \ \ \
| |/ / / /
|/| | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add basic tests for `bot.cogs.information`.
|
|/ / / / / |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- Changed the if statement to use `is None` for code clarity.
Signed-off-by: Daniel Brown <[email protected]>
|
| |\ \ \ \
| |/ / / /
|/| | | |
| | | | | |
https://github.com/python-discord/bot into hemlock-infraction-date-humanization
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
Escape markdown in codeblock suggestion embed
|
| |\ \ \ \
| |/ / / /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
https://github.com/python-discord/bot/issues/434
If the content we prepare for the codeblock suggestion embed defined
in the `bot` cog contains markdown characters (e.g., `__`, `**`), this
will cause Discord to apply markdown, since both the codeblock syntax
example as well as the codeblock result example will contain the
characters, making it a matched formatting pair.
This will hide those characters, which often have a function in the
code, and break the example of a formatted codeblock.
To deal with that, I've added a regex substitution that substitutes
markdown characters by an escaped version of that markdown character.
Example:
`'__hello__'` will become `'\_\_hello\_\_'`
I've added this substitution to both paths in the `on_message` event
listener, since we can't substitute at an earlier place due to it
generating `SyntaxErrors` with the `ast.parse` check.
This closes #434
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- Changed to use the format `"%Y-%m-%d %H:%M"`, which will turn out looking like `2019-09-18 13:59`
Signed-off-by: Daniel Brown <[email protected]>
|
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | | |
- Changed the date returned on infraction searches to use the `"%c"` strftime format instead of the standard ISO format.
Signed-off-by: Daniel Brown <[email protected]>
|
|\ \ \ \
| |/ / /
|/| | | |
Enhance off-topic names search feature
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
https://github.com/python-discord/bot/issues/435
This commit is meant to enhance the search feature in three separate,
but related ways:
1. By changing the type annotation of the query to OffTopicName, we
will use the same character translation table for the query as we
did when storing the off-topic name, leading to better matches.
2. By adding a membership test, `query in name`, we are better able to
search for off-topic names using a substring.
3. Given point 1 and point 2, we can increase the cut-off value we use
for `difflib.get_close_matches` so we reduce the number of matches
that bear little resemblance to the query in our human eyes.
This commit closes #435
|
|\ \ \
| | | |
| | | | |
Add basic tests for `bot.api`.
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Validate configuration against typehints, remove old keys, rename off_topic_3 key
|