Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: loop host context through #3

Merged
merged 5 commits into from
Jul 12, 2024
Merged

Conversation

chrisdickinson
Copy link
Contributor

This WIP PR depends on a couple of other PRs:

This PR breaks up the message_handler into a plugins 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 a interest_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.)

@chrisdickinson chrisdickinson marked this pull request as ready for review July 12, 2024 18:14
@chrisdickinson chrisdickinson merged commit e454893 into main Jul 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant