Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This WIP PR depends on a couple of other PRs:
This PR breaks up the
message_handler
into aplugins
table that holds info about what a plugin can do & where it can listen and various "interests" tables. (E.g., a plugin interested in a regex would subscribe via ainterest_message_content
row.)We put a rudimentary token bucket ratelimiting scheme in place to prevent plugins from misbehaving.
And finally we expose (stub) functionality for sending messages, "watching" messages, reacting, and making HTTP requests. (This is separate from the
extism_http
functionality since we want to give different plugins different allowedHosts. This is enabled by the aforementioned PRs: this lets us loop through host-specific context about the call to host functions so we can loop the Discord client through (along with info about the handler & its available ratelimiting tokens.)