aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| * | | | | | | | | | | | | | | | | | (Moderation Utils Tests): Created tests for `notify_infraction` function.Gravatar ks1232020-03-04-2/+91
| | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | (Moderation Utils Tests): Created tests for `has_active_infraction` functionGravatar ks1232020-03-03-0/+24
| | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | (Moderation Utils Tests): Added imports, modified tests class instance and ↵Gravatar ks1232020-03-03-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | created new params for tests class
| * | | | | | | | | | | | | | | | | | Created file for moderation utils tests + added setUp to this.Gravatar ks1232020-03-03-0/+12
| | | | | | | | | | | | | | | | | | |
| | | | * | | | | | | | | | | | | | | Fix cog_check testsGravatar MarkKoz2020-09-08-8/+12
| | | | | | | | | | | | | | | | | | |
| | | | * | | | | | | | | | | | | | | Fix tests for has_any_role_checkGravatar MarkKoz2020-09-08-16/+18
| | | | | | | | | | | | | | | | | | |
| | | | * | | | | | | | | | | | | | | Rename role checks and decoratorsGravatar MarkKoz2020-09-08-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make their names more in line with `has_any_role` for consistency.
| | | | * | | | | | | | | | | | | | | Implement role checks using has_any_roleGravatar MarkKoz2020-09-07-34/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `has_any_role` to reduce redundancy. Because discord.py always makes a check's predicate a coroutine, the checks now have to be awaited.
| | | | * | | | | | | | | | | | | | | Use has_any_role's predicate directlyGravatar MarkKoz2020-09-06-31/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some places, it's more appropriate than using with_role_check since it will raise CheckFailures. This applies to `cog_check`s and other things which effectively act as command checks.
| | | | * | | | | | | | | | | | | | | Implement the without_role decorator by negating has_any_roleGravatar MarkKoz2020-09-06-6/+17
| | | | | | | | | | | | | | | | | | |
| | | | * | | | | | | | | | | | | | | Remove with_role decorator in favour of has_any_roleGravatar MarkKoz2020-09-05-76/+58
| | | | | |_|_|_|/ / / / / / / / / / | | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `with_role` is obsolete because discord.py provides `has_any_role`.
| | | | | | | * | | | | | | | | | | Create a UserMention converterGravatar MarkKoz2020-08-11-4/+20
| | | | | | | | | | | | | | | | | |
| | | | | | | * | | | | | | | | | | Replace InfractionSearchQuery with a generic Snowflake converterGravatar MarkKoz2020-08-11-13/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's unnecessarily precise to do an fetch user API call in order to distinguish between a user and a reason. Furthermore, a User object isn't actually required for infraction searches - only an ID is.
| | | | | | | * | | | | | | | | | | Resolve conflicts in filtering.pyGravatar MarkKoz2020-08-10-562/+894
| | | | | | | |\ \ \ \ \ \ \ \ \ \ \
| | | | | | | * | | | | | | | | | | | Zero-fill discriminators in infraction searchesGravatar MarkKoz2020-08-10-1/+1
| | | | | | | | | | | | | | | | | | |
| | | | | | | * | | | | | | | | | | | Use format_user in token remover testGravatar MarkKoz2020-08-10-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The point of format_user is to have a consistent format across the code base. That should apply to tests too.
| | | | | | | * | | | | | | | | | | | Concatenate string in one lineGravatar MarkKoz2020-08-10-2/+1
| | | | | | | | | | | | | | | | | | |
| | | | | | | * | | | | | | | | | | | Fix conflict with disabling filter ping for DMsGravatar MarkKoz2020-08-02-68/+307
| | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | |_|_|/ / / / / / / / | | | | | | | | |/| | | | | | | | | |
| | | | | | | * | | | | | | | | | | | Fix test for token remover log messageGravatar MarkKoz2020-07-21-2/+1
| | | | | | | | | | | | | | | | | | |
| | | | | | | * | | | | | | | | | | | Use user mentions in infraction search resultsGravatar MarkKoz2020-07-21-14/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using our expanded API is more efficient than making a request to the Discord API for potentially every user in the search results. The data may not be up to date, but that's an acceptable compromise.
| | | | | | | * | | | | | | | | | | | ModLog: use user mentionsGravatar MarkKoz2020-07-21-22/+12
| | | | | | | | | | | | | | | | | | |
| | | | | | | * | | | | | | | | | | | Filtering: use user mentions in mod logsGravatar MarkKoz2020-07-21-6/+5
| | | | | | | | | | | | | | | | | | |
| | | | | | | * | | | | | | | | | | | Filtering: refactor _add_stats to return a NamedTupleGravatar MarkKoz2020-07-21-25/+27
| | | | | | | | | | | | | | | | | | |
| | | | | | | * | | | | | | | | | | | Filtering: refactor sending of mod logGravatar MarkKoz2020-07-21-59/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of redundant code existed between the message and eval filters.
| | | | | | | * | | | | | | | | | | | Use user mentions in mod logsGravatar MarkKoz2020-07-21-10/+14
| | | | | | | | | | | | | | | | | | |
| | | | | | | * | | | | | | | | | | | Moderation: use user mentions in mod logsGravatar MarkKoz2020-07-21-18/+14
| | | | | | | | | | | | | | | | | | |
| | | | | | | * | | | | | | | | | | | Moderation: remove multiple active infractions checkGravatar MarkKoz2020-07-21-36/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API was change a long time ago to not allow such a situation.
| | | | | | | * | | | | | | | | | | | Superstarify: escape Markdown in nicknamesGravatar MarkKoz2020-07-21-1/+4
| | | | | | | | | | | | | | | | | | |
| | | | | | | * | | | | | | | | | | | Superstarify: use user mentions in mod logsGravatar MarkKoz2020-07-21-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `format_user` isn't used in the apply mod log cause it already shows both the old and new nicknames elsewhere.
| | | | | | | * | | | | | | | | | | | Add util function to format user namesGravatar MarkKoz2020-07-21-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be used a lot when sending mod logs and will help with reducing redundancy and maintaining consistency.
| | | | | | | * | | | | | | | | | | | Clean up importsGravatar MarkKoz2020-07-21-14/+13
| | | | | | | | | | | | | | | | | | |
| | | | | | | | | | * | | | | | | | | Constants: remove staff_channelsGravatar MarkKoz2020-09-02-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No longer being used anywhere.
| | | | | | | | | | * | | | | | | | | Fix user command testsGravatar MarkKoz2020-08-26-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mocking the bot commands channel constant no longer worked after switching to `in_whitelist_check`.
| | | | | | | | | | * | | | | | | | | Fix infraction counts being shown in wrong channelsGravatar MarkKoz2020-08-26-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They should only be shown in mod channels, not all staff channels. Fix #1127
| | | | | | | | | | * | | | | | | | | Info: show verbose infractions if user cmd invoked in modmailGravatar MarkKoz2020-08-25-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix #1125
| | | | | | | | | | * | | | | | | | | Info: simplify channel redirection for the user commandGravatar MarkKoz2020-08-25-9/+5
| | | | | | | | | | | |_|_|_|_|/ / / | | | | | | | | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `in_whitelist_check` is a convenient utility that does the same thing as the previous code.
| | | | | | | | | | | | * | | | | | Update users on bot start via HTTP PATCH method and send only user ID and ↵Gravatar RohanJnr2020-09-25-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the modified user data.
| | | | | | | | | | | | * | | | | | fix type and add variable type hintingGravatar RohanJnr2020-09-22-2/+1
| | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | * | | | | | Refactor code to make use of bulk create and update API endpoints.Gravatar RohanJnr2020-09-22-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of creating and updating a single user at a time, a list of dicts will be sent for bulk update and creation.
| | | | | | | | | | | | * | | | | | Merge remote-tracking branch 'upstream/master' into smart_syncing_usersGravatar RohanJnr2020-09-21-257/+301
| | | | | | | | | | | | |\ \ \ \ \ \ | |_|_|_|_|_|_|_|_|_|_|_|/ / / / / / |/| | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | Merge pull request #1103 from python-discord/feat/backend/160/cog-subdirsGravatar Kieran Siek2020-09-21-257/+301
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | Move cogs to subdirectories
| * | | | | | | | | | | | | | | | | Merge branch 'master' into feat/backend/160/cog-subdirsGravatar kosayoda2020-09-21-811/+1257
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | Categorise most of the uncategorised extensionsGravatar MarkKoz2020-08-19-5/+5
| | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | Dynamically discover and load extensions upon startupGravatar MarkKoz2020-08-19-61/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Being explicit is nice, but the list of extensions to load has gotten quite long. It's a bit of an eyesore. It's still fairly easy to temporarily exclude extensions: just remove them from the set. Granted, being able to comment them out was more convenient.
| * | | | | | | | | | | | | | | | | Extensions: move utility functions to a utility moduleGravatar MarkKoz2020-08-19-29/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the cog cleaner and makes the functions more accessible for other modules.
| * | | | | | | | | | | | | | | | | Extensions: beautify name unqualificationGravatar MarkKoz2020-08-19-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yes, that's a real word.
| * | | | | | | | | | | | | | | | | Replace relative imports with absolute onesGravatar MarkKoz2020-08-19-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PEP 8 recommends absolute imports over relative ones.
| * | | | | | | | | | | | | | | | | Add comment to explain why import is deferredGravatar MarkKoz2020-08-19-0/+1
| | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | Rename "cogs" directory to "exts"Gravatar MarkKoz2020-08-14-163/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The directory contains modules, which are extensions. It only indirectly contains cogs through the extensions. Therefore, a technically more accurate name is "extensions", or "exts" when abbreviated. Furthermore, "exts" is consistent with SeasonalBot.
| * | | | | | | | | | | | | | | | | Defer imports in extensions using __init__.pyGravatar MarkKoz2020-08-14-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since `pkgutil.walk_packages` imports packages it comes across, it's best to avoid potential side effects from imports.