aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | * | | | | | | | | | | | | Fix missing await in bad nickname filterGravatar MarkKoz2020-05-31-18/+17
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | Filtering: Small fixesGravatar ks1292020-05-31-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use UTC from timestamp - Rename name bad words checking function
| | * | | | | | | | | | | | | Filtering: Fix docstringGravatar ks1292020-05-31-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Mark <[email protected]>
| | * | | | | | | | | | | | | Merge remote-tracking branch 'origin/bad-words-nick' into bad-words-nickGravatar ks1292020-05-31-4/+1
| | |\ \ \ \ \ \ \ \ \ \ \ \ \
| | | * | | | | | | | | | | | | Filtering: Create lock in `__init__`Gravatar ks1292020-05-30-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move lock creation from `bad_words_in_name` to `__init__`
| | * | | | | | | | | | | | | | Filtering: Split name filtering to smaller functionsGravatar ks1292020-05-31-11/+24
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Filtering: On name filtering, replace Message with Embed as argumentGravatar ks1292020-05-31-7/+7
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Filtering: Add days between alerts as constantGravatar ks1292020-05-31-1/+3
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Filtering: Rename `bad_words_in_name` to `check_is_bad_words_in_name`Gravatar ks1292020-05-31-2/+2
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Filtering: Use POSIX instead ISO format to storage alert cooldownsGravatar ks1292020-05-31-3/+2
| | |/ / / / / / / / / / / / /
| | * | | | | | | | | | | | | Filtering: Refactor bad names checkingGravatar ks1292020-05-29-31/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make `bad_words_in_name` and attach it to current `on_message`. - Implement `asyncio.Lock` to avoid race conditions. - Made that this first check is there matches and when there is, check for alert.
| | * | | | | | | | | | | | | Filtering: Implement bad words detection in nicknamesGravatar ks1292020-05-29-0/+41
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: extend documentationGravatar kwzrd2020-06-12-11/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a proper class docstring & small touch-ups to local comments where necessary.
* | | | | | | | | | | | | | | Incidents: avoid lambda check; make regular functionGravatar kwzrd2020-06-12-5/+5
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: log `event_lock` releaseGravatar kwzrd2020-06-12-0/+1
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: do not process reaction events from botsGravatar kwzrd2020-06-12-2/+3
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: implement `process_event` coroutineGravatar kwzrd2020-06-12-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This contains the main logic for handling reactions and glues all the helpers together. Unfortunately, gracefully handling everything that can go wrong in the process requires quite a lot of code ~ but, at least to me, it seems like this all should now be fairly safe. The idea to await the message delete event before releasing the lock was conceived by Ves, while Mark helped me refine it. Co-authored-by: Sebastiaan Zeeff <[email protected]> Co-authored-by: MarkKoz <[email protected]>
* | | | | | | | | | | | | | | Incidents: implement `make_confirmation_task` methodGravatar kwzrd2020-06-12-0/+15
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: implement `archive` methodGravatar kwzrd2020-06-12-1/+39
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: implement reaction listenerGravatar kwzrd2020-06-12-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See docstring!
* | | | | | | | | | | | | | | Incidents: implement `resolve_message`Gravatar kwzrd2020-06-12-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See docstring. The exception log is DEBUG level as failure does not necessarily indicate that we have done something wrong. We rely on the API to tell us that the message no longer exists in situations where we have 2 coroutines racing to archive the same message.
* | | | | | | | | | | | | | | Incidents: make `crawl_incidents` smarterGravatar kwzrd2020-06-12-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crawler now avoids making API calls for messages which: * Are not incidents * Already have all signals As a result, we can sleep only after making actual calls. This speeds up the task completion considerable, while also making it lighter on the API. Victory!
* | | | | | | | | | | | | | | Incidents: move `add_signals` to module namespaceGravatar kwzrd2020-06-12-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looks like we'll need quite a few helpers, and I think it's cleaner to keep them at module level. It helps avoid the question of: what do I do if a staticmethod depends on another staticmethod?
* | | | | | | | | | | | | | | Incidents: implement `has_signals` helperGravatar kwzrd2020-06-12-0/+6
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: implement `own_reactions` helperGravatar kwzrd2020-06-12-1/+6
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: abstract incident checking into a helper methodGravatar kwzrd2020-06-12-24/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code is now basically self-documenting, the docstring is no longer necessary. The ultimate goal is to allow `crawl_incidents` to be more smart about which messages need to be passed to `add_signals`, so that it doesn't need to sleep after each message.
* | | | | | | | | | | | | | | Incidents: add `event_lock` for simple event synchronizationGravatar kwzrd2020-06-12-1/+3
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: only `add_signals` if missingGravatar kwzrd2020-06-12-2/+10
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: make `on_message` ignore pinned messagesGravatar kwzrd2020-06-12-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is now necessary as we call the listener ourselves from the crawl task. An already existing, pinned message, can be received.
* | | | | | | | | | | | | | | Incidents: implement & schedule `crawl_incidents` taskGravatar kwzrd2020-06-12-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See docstring for further information. This will run on start-up to retroactively add missing emoji. Ratelimit-wise this should be fine, as there should never be too many missing emoji.
* | | | | | | | | | | | | | | Incidents: implement `on_message` listener & guardsGravatar kwzrd2020-06-12-3/+20
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: implement `add_signals` helperGravatar kwzrd2020-06-12-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looks like it can be static, at least for now.
* | | | | | | | | | | | | | | Incidents: define method stubs for message event handlingGravatar kwzrd2020-06-12-0/+10
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Incidents: define allowed roles and emojiGravatar kwzrd2020-06-11-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These serve as whitelists, i.e. any reaction using an emoji not explicitly allowed, or from a user not specifically allowed, will be rejected. Such reactions will be removed by the bot.
* | | | | | | | | | | | | | | Merge branch 'origin/master' into kwzrd/incidentsGravatar kwzrd2020-06-11-53/+115
|\| | | | | | | | | | | | | |
| * | | | | | | | | | | | | | Merge pull request #995 from python-discord/add-cooldown-channelGravatar Mark2020-06-11-1/+3
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add cooldown channel to config-default.yml
| | * | | | | | | | | | | | | | Add cooldown to Channels in constants.pyGravatar Joseph Banks2020-06-11-0/+1
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Add cooldown channel to EXCLUDED_CHANNELS tupleGravatar Joseph Banks2020-06-11-1/+1
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Add cooldown channel to config-default.ymlGravatar Joseph Banks2020-06-11-0/+1
| |/ / / / / / / / / / / / / /
| * | | | | | | | | | | | | | Fix trailing whitespace in Action fileGravatar Joseph Banks2020-06-11-1/+1
| | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | Create codeql-analysis.ymlGravatar Joseph Banks2020-06-11-0/+32
| | |/ / / / / / / / / / / / | |/| | | | | | | | | | | |
| * | | | | | | | | | | | | Merge pull request #910 from python-discord/bug/backend/906/converter-year-rangeGravatar Joseph Banks2020-06-10-52/+66
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converters: handle ValueError when year for duration is out of range
| | * \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into bug/backend/906/converter-year-rangeGravatar Joseph Banks2020-06-10-1194/+2938
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / | |/| | | | | | | | | | | | |
| * | | | | | | | | | | | | | Merge pull request #988 from python-discord/snekbox-composeGravatar Joseph Banks2020-06-10-0/+9
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add snekbox to the Docker compose file
| | * \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into snekbox-composeGravatar Joseph Banks2020-06-10-2/+14
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / / | |/| | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Merge pull request #935 from python-discord/bug/mod/932/modlog-ignore-dmsGravatar Joseph Banks2020-06-10-0/+4
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ModLog: ignore DMs in the message delete listener
| | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into bug/mod/932/modlog-ignore-dmsGravatar Joseph Banks2020-06-10-1061/+2576
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / / / | |/| | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Add Python Atlanta to guild whitelistsGravatar Joseph Banks2020-06-09-0/+1
| | | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | | ModLog: ignore DMs in the message delete listenerGravatar MarkKoz2020-05-10-0/+4
| | | | | | | | | | | | | | | | |
| | | * | | | | | | | | | | | | | Add snekbox to the Docker compose fileGravatar MarkKoz2020-06-05-0/+9
| | | | |_|_|_|_|/ / / / / / / / | | | |/| | | | | | | | | | | |