Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WordFilter] Try compiling RegEx before adding
This commit resolves SFUAnime#646 by compiling RegEx before adding a RegEx string into WordFilter's books. With this commit, at word filter insertion time (`[p]wordfilter regex add <word>`), `re.compile` will be invoked, and if there is a `re.error`, a message will be sent to where the command has been invoked to notify the user executing the command about the invalid RegEx pattern that was input. Without this commit, the cog will crash when it tries to substitute/match/search invalid RegEx patterns during handling of an `on_message` event. See SFUAnime#646 for an example traceback.
- Loading branch information