Lua-based module system #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Revamp the module system by throwing away the current TOML based configuration loader and using a lua script to define modules.
Each tqm module (
discord,irc,autolinketc) is exported as a lua module, which can be imported withrequire. The module provides anewfunction, which takes a config (largely equivalent to the TOML config) returning a table of event handlers as well as other methods specific to that module. For example,discordorircmight have some way to send a message to a server/channel.Event-producing modules will also return a
subscribemethod, which can accept any number of other module instances (or just a table with the relevant methods). The idea is that the underlying machinery (the event system, chat connections, and some modules) are written in rust but hooked up by the user in lua.