| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
|
|
| |
The FetchedUser Converter now counts with a `proxy_user` helper function (which
SHOULD NOT be there) to return a user as a last resource, in case
there was an issue fetching from the Discord API, as long as the error
isn't that there's no user with the given ID.
|
| |
|
|
|
|
|
| |
Now `post_user(...)` expects either a `discord.User` or a
`discord.Object` object as `user`. Either way, it will try to take the relevant
attributes from `user` to fill the DB columns. If it can't be done,
`.avatar_hash`, `.discriminator`, and `name` will take default values.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Try twice to apply the infraction. If the user is not in the database,
try to add it, then try to apply the infraction again.
This allows any moderation function that uses `FetchedUser` as a
converter to apply the infraction even when the user is absent in the
local database.
|
| |
|
|
|
|
|
|
| |
As it is now, this function is planned to be used a big-helper in
`post_infraction`. Its interface is partially similar: it will return
a "JSON" dictionary if everything went well, or `None` if it
failed. If it fails, it will send a message to the channel and
register the issue in the `log`.
|
| | |
|
| |
|
|
|
|
| |
This `discord.ext.commands.Converter` fetches a user from the Discord
API and returns a `discord.User` object. This should replace the
`proxy_user` function from the moderation `utils`.
|
| |\
| |
| |
| |
| | |
Use OAuth to be Reddit API compliant
Co-authored-by: null <[email protected]>
|
| | |\
| |/
|/| |
|
| |\ \
| | |
| | | |
Moderation: show emoji for DM failure instead of mentioning actor
|
| | |\ \
| |/ /
|/| | |
|
| |\ \ \
| | | |
| | | | |
Allow mods+ to use commands and delete bots' messages in checkpoint channel
|
| | |\ \ \
| |/ / /
|/| | | |
|
| |\ \ \ \
| | | | |
| | | | | |
Clean command improvements
|
| | |\ \ \ \
| |/ / / /
|/| | | | |
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
python-discord/Write-unit-tests-for-`bot/utils/time.py`
Added `unittest` for `bot.utils.time`
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Similar to `format_infraction_with_duration` ( if not outright copying it ), added 3 tests for `until_expiration`:
- None `expiry`.
- Custom `max_units`.
- Normal use cases.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
`format_infraction_with_duration`
- `until_expiration` was being a pain to unittests without a `now` ( default to `datetime.utcnow()` ). Adding an optional argument for this will not only make writing tests easier, but also allow more control over the helper function should we need to calculate the remaining time between two dates in the past.
- Changed typehint for `date_from` in `format_infraction_with_duration` to `Optional[datetime.datetime]` to better reflect what it is.
|
| | |\ \ \ \ \ |
|
| | |\ \ \ \ \ \ |
|
| | | | | | | | | |
|
| | | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
context manager.
|
| | | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
test case tests.
|
| | | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
`test_parse_rfc1123`, fixed typo.
|
| | | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
independent tests.
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | |\ \ \ \ |
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This make the channel specifiable without the amount.
Co-Authored-By: scragly <[email protected]>
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Messages are deleted after a delay of 10 seconds. This helps keep the
channel clean. The periodic ping is an exception; it will remain.
|
| | | | | | |/ / /
| | | | |/| | | |
|
| | | | | | |/ /
| | | | |/| | |
|
| | |_|_|_|_|/
|/| | | | | |
|
| |\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Revert "Use OAuth to be Reddit API compliant"
|
| |/ / / / / / |
|
| |\ \ \ \ \ \
| |_|_|/ / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Use OAuth to be Reddit API compliant
Co-authored-by: Jens <[email protected]>
Co-authored-by: Mark <[email protected]>
Co-authored-by: null <[email protected]>
|
| | |\ \ \ \ \
| |/ / / / /
|/| | | | | |
|
| |\ \ \ \ \ \
| |_|_|/ / /
|/| | | | |
| | | | | |
| | | | | | |
Display time left until expiration of infraction
Co-authored-by: null <[email protected]>
|
| | |\ \ \ \ \
| |/ / / / /
|/| | | | | |
|
| |\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Allow "recent" as infraction ID for infraction edit command
|
| | |\ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
|
| |\ \ \ \ \ \ \
| |_|_|_|_|_|/
|/| | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Token and bad code
Co-authored-by: Daniel Brown <[email protected]>
Co-authored-by: Mark <[email protected]>
|
| | |\ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
|