| Commit message (Collapse) | Author | Age | Lines |
|\
| |
| | |
Refactor time utilities
|
| |\
| |/
|/| |
|
|\ \
| | |
| | | |
Add bot-core as a dependency
|
| |\ \
| |/ /
|/| | |
|
|\ \ \
| | | |
| | | | |
Fix pastebin hyperlink to use correct markdown syntax
|
|/ / /
| | |
| | |
| | |
| | | |
Fix format from `[link](text)` to `[text](link)` so that the link will
be formatted as it should be.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
This moves the regex closer to the place actually using the regex, and removes the need for a regex.py file entirely.
|
| | | |
|
|/ / |
|
| | |
|
| | |
|
| |
| |
| |
| | |
They're equivalent for UTC. Get rid of the extra import.
|
| | |
|
| |
| |
| |
| | |
It wasn't passing the current time when `other_timestamp` was None.
|
| | |
|
| |
| |
| |
| |
| | |
Integers and floats which are 0 are considered valid timestamps, but are
falsy.
|
| |
| |
| |
| |
| | |
None was returned for two separate cases: permanent infractions and
expired infractions. This resulted in an ambiguity.
|
| |
| |
| |
| |
| |
| |
| | |
Mock User.created_at and User.joined_at because `arrow.get()` doesn't
work with Mock objects. The old implementation of
`time.discord_timestamp` accepted mocks because it just did `int()` on
any type it didn't explicitly check for.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Remove the need for the caller to create a `relativedelta` from 2
timestamps before calling `humanize_delta`. This is especially
convenient for cases where the original inputs aren't `datetime`s
since `relativedelta` only accepts those.
|
| |
| |
| |
| | |
There's a saner way to parse the timestamp that relied on this regex.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the burden of conversion from the caller to clean up and simplify
the call sites. Handle timestamp conversions internally with arrow.get.
Remove format_infraction and get_time_delta because they're now
obsolete. Replace the former with discord_timestamp and the latter with
format_relative.
|
| |
| |
| |
| | |
It's not necessarily tied to infractions anymore.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a delta is given, it is unknown what it's relative to. The function
has to assume it's relative to the POSIX Epoch. However, using a delta
for this would be quite odd, and would more likely be a mistake if
anything.
relativedelta support was broken anyway since it wasn't using the
total seconds represented by the delta.
|
| |
| |
| |
| |
| |
| | |
First, the `args` attribute doesn't exist on enums. Even if it did, this
check only works if the argument given is an enum member (of any enum).
Such occurrence seems too rare to warrant an explicit check.
|
| |
| |
| |
| |
| | |
It's not used anywhere. Furthermore, a humanised duration with negative
values wouldn't make sense.
|
| |
| |
| |
| |
| | |
Use the latter where the former was being called with the relative
format type.
|
| |
| |
| |
| |
| |
| |
| | |
While the function is basically just a wrapper for discord_timestamp
now, it is very common to use the relative format. It's cumbersome
to import the format enum and pass it to discord_timestamp calls, so
keeping this function around will be nice.
|
| |
| |
| |
| |
| |
| |
| | |
In cases where many time utility functions were being imported, this
makes the imports shorter and cleaner. In other cases, the function
names read better when they're qualified with "time"; the extra context
it adds is helpful.
|
|/
|
|
| |
It's not used anywhere and hasn't been for a very long time.
|
| |
|
|\ |
|
| | |
|
|/ |
|
|
|
| |
Not doing so could cause an error where get_channel would return none for the mod logs channel.
|
|\
| |
| | |
Infraction mod-log improvements
|
|/
|
|
|
|
| |
- Add infraction id to infraction edit modlog
- Add missing colon in "infraction applied" message
- Utilise defined infraction id variable instead of indexing dict again
|
|
|
| |
Co-authored-by: Xithrius <[email protected]>
|
|
|
| |
* adding strip-gotcha tag
|
|
|
| |
Co-authored-by: Xithrius <[email protected]>
|
|\
| |
| | |
feat: added url parsing to the filter
|
| | |
|
|/ |
|
| |
|
|\ |
|
|/ |
|
|\
| |
| | |
Display whether DM was sent to user when listing infraction(s).
|