aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* chore: Switch Snekbox.prepare_input with a CodeblockConverterGravatar ToxicKidz2022-01-27-90/+91
| | | | As per @Numerlor's suggestion
* Merge branch 'main' of https://github.com/python-discord/bot into ↵Gravatar ToxicKidz2022-01-26-331/+385
|\ | | | | | | feat/timeit-command
| * Add missing restart-policy to metricity containerGravatar Chris Lovering2022-01-26-0/+1
| |
| * setuptools use stdlib distutils over embeddedGravatar Chris Lovering2022-01-26-0/+4
| | | | | | | | | | | | This is caused by an upstream issue with setuptools 60.* (via virtualenv) changeing the default to using the setuptools-embedded distutils rather than the stdlib distutils, which breaks within pip's isolated builds. This is explained quite well here https://github.com/pre-commit/pre-commit/issues/2178#issuecomment-1002163763
| * Add missing arguments to `notify_infraction` callGravatar Izan2022-01-25-2/+6
| | | | | | | | Fixes an issue caused by #1951.
| * Merge pull request #2059 from novialriptide/novial-simple-renameGravatar Hassan Abouelela2022-01-26-1/+1
| |\
| | * Rename `contributing guidelines` to `contribution guide`Gravatar Andrew Hong2022-01-25-1/+1
| |/
| * Remove dev-contrib and bot-commands from features listGravatar Joe Banks2022-01-24-2/+0
| |
| * Merge pull request #1721 from python-discord/enhance/backend/time-util-refactorGravatar Hassan Abouelela2022-01-22-207/+283
| |\ | | | | | | Refactor time utilities
| | * Merge branch 'main' into enhance/backend/time-util-refactorGravatar Hassan Abouelela2022-01-22-119/+90
| | |\ | | |/ | |/|
| * | Merge pull request #2043 from python-discord/add-bot-coreGravatar wookie1842022-01-17-111/+88
| |\ \ | | | | | | | | Add bot-core as a dependency
| | * \ Merge branch 'main' into add-bot-coreGravatar wookie1842022-01-17-8/+2
| | |\ \ | | |/ / | |/| |
| * | | Merge pull request #2050 from Nipa-Code/fix-hyperlinkGravatar Hassan Abouelela2022-01-17-1/+1
| |\ \ \ | | | | | | | | | | Fix pastebin hyperlink to use correct markdown syntax
| | * | | Fix pastebin hyperlink to use correct markdown syntaxGravatar Nipa-Code2022-01-17-1/+1
| |/ / / | | | | | | | | | | | | | | | | Fix format from `[link](text)` to `[text](link)` so that the link will be formatted as it should be.
| * | | Shorten the `TXT_EMBED_DESCRIPTION` message (#2048)Gravatar Steele Farnsworth2022-01-16-8/+2
| | | |
| | * | Use codeblock regex from bot-core in snekbox cogGravatar Chris Lovering2022-01-09-15/+1
| | | |
| | * | Move single-use message ID regex to inside file that uses itGravatar Chris Lovering2022-01-09-4/+2
| | | | | | | | | | | | | | | | This moves the regex closer to the place actually using the regex, and removes the need for a regex.py file entirely.
| | * | use regex from bot-core for discord invitesGravatar Chris Lovering2022-01-09-16/+4
| | | |
| | * | Add bot-core as a dependancyGravatar Chris Lovering2022-01-09-76/+81
| |/ /
| | * Time: revise docstringsGravatar MarkKoz2022-01-09-7/+9
| | |
| | * Scheduling: add Arrow to schedule_at's type annotationsGravatar MarkKoz2022-01-09-1/+3
| | |
| | * Converters: use datetime.timezone instead of dateutil.tzGravatar MarkKoz2022-01-09-3/+2
| | | | | | | | | | | | They're equivalent for UTC. Get rid of the extra import.
| | * TalentPool: fix typo in error messageGravatar MarkKoz2021-09-21-2/+2
| | |
| | * Time: fix format_with_duration's 2nd arg's defaultGravatar MarkKoz2021-09-21-0/+3
| | | | | | | | | | | | It wasn't passing the current time when `other_timestamp` was None.
| | * Time: put region comments around overloadsGravatar MarkKoz2021-08-23-0/+2
| | |
| | * Time: check timestamp for None only rather than if it's falsyGravatar MarkKoz2021-08-07-4/+4
| | | | | | | | | | | | | | | Integers and floats which are 0 are considered valid timestamps, but are falsy.
| | * Time: return strings from until_expiration instead of ambiguous NoneGravatar MarkKoz2021-08-07-10/+9
| | | | | | | | | | | | | | | None was returned for two separate cases: permanent infractions and expired infractions. This resulted in an ambiguity.
| | * Fix create_user_embed testsGravatar MarkKoz2021-08-07-0/+9
| | | | | | | | | | | | | | | | | | | | | 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.
| | * Time: use typing.Literal for precision param of humanize_deltaGravatar MarkKoz2021-08-06-5/+6
| | |
| | * Time: add overload to pass relativedelta kwargs to humanize_deltaGravatar MarkKoz2021-08-06-4/+32
| | |
| | * Time: add overload to pass 2 timestamps to humanize_deltaGravatar MarkKoz2021-08-06-30/+105
| | | | | | | | | | | | | | | | | | | | | 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.
| | * Time: remove DISCORD_TIMESTAMP_REGEXGravatar MarkKoz2021-08-05-11/+6
| | | | | | | | | | | | There's a saner way to parse the timestamp that relied on this regex.
| | * Time: support more timestamp formats as argumentsGravatar MarkKoz2021-08-05-73/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * Time: rename format_infraction_with_durationGravatar MarkKoz2021-08-05-22/+22
| | | | | | | | | | | | It's not necessarily tied to infractions anymore.
| | * Time: remove timedelta and relativedelta support from discord_timestampGravatar MarkKoz2021-08-05-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * Time: remove broken enum type check in discord_timestampGravatar MarkKoz2021-08-05-3/+0
| | | | | | | | | | | | | | | | | | 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.
| | * Time: remove absolute param from format_infraction_with_durationGravatar MarkKoz2021-08-05-8/+1
| | | | | | | | | | | | | | | It's not used anywhere. Furthermore, a humanised duration with negative values wouldn't make sense.
| | * Time: replace discord_timestamp calls with format_relativeGravatar MarkKoz2021-08-05-6/+6
| | | | | | | | | | | | | | | Use the latter where the former was being called with the relative format type.
| | * Time: rename time_since to format_relativeGravatar MarkKoz2021-08-05-8/+13
| | | | | | | | | | | | | | | | | | | | | 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.
| | * Time: qualify uses of functions with the module nameGravatar MarkKoz2021-08-05-58/+51
| | | | | | | | | | | | | | | | | | | | | 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.
| | * Time: remove RFC1123 supportGravatar MarkKoz2021-08-05-13/+0
| |/ | | | | | | It's not used anywhere and hasn't been for a very long time.
* | chore: Remove the naming of 'eval' in certain placesGravatar ToxicKidz2022-01-26-41/+41
| | | | | | | | Since the !eval command is no longer the only snekbox command, make the naming more generic.
* | chore: Apply suggestionsGravatar ToxicKidz2022-01-18-8/+7
| | | | | | | | | | As per Numerlor's suggestions, update docstrings, remove unused variables and fix a TypeError if the code is None.
* | chore: Apply suggestions and adjust testsGravatar ToxicKidz2022-01-17-47/+29
| |
* | fix: Modify tests to correspond with Snekbox.continue_evalGravatar ToxicKidz2022-01-17-8/+11
| |
* | Merge branch 'feat/timeit-command' of https://github.com/python-discord/bot ↵Gravatar ToxicKidz2022-01-17-1/+1
|\ \ | | | | | | | | | into feat/timeit-command
| * | chore: fix a typoGravatar ToxicKidz2022-01-14-1/+1
| | | | | | | | | Co-authored-by: Bluenix <[email protected]>
* | | fix: Add timeit parsing when the command gets reinvokedGravatar ToxicKidz2022-01-17-13/+34
|/ /
* | chore: Suppress output in the setup code, not the code that gets timed.Gravatar ToxicKidz2022-01-13-20/+56
| | | | | | | | If multiple formatted codeblocks are passed to the command, the first one will be used as the setup code that does not get timed.
* | chore: Fix merge conflictsGravatar ToxicKidz2022-01-13-3796/+8294
|\|