Commit Graph

7 Commits

Author SHA1 Message Date
8789f8b097 Add top-level channels to configuration
If you want all modules to act on all channels, you can simply set
`channels: :all` on all modules, and add `channels: ["#channel",
"#channel", ...]` to the same configuration level as `plugins`. These
are added to the "all channels" list and joined automatically.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-08-18 16:28:45 -07:00
2f378dd438 Finish removing Omnibot.State functions
Omnibot.State shouldn't be used anywhere anymore except as a GenServer
being started up in the supervisor.

Also, configuration must be loaded through Config.load/1 rather than
being constructed, because everything expects a tuple of {plugin,
config} now.

Finally, Omnibot.Core must be added to the configuration in order for
basic functionality.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-08-11 15:23:53 -07:00
192e1b2b08 Add Omnibot.Config documentation
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-07-21 18:09:15 -07:00
8f112487c1 Update the instance of "module" with "plugin" and "mod" with "plug" where appropriate
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-07-02 18:30:46 -07:00
304a8d4164 WIP: Move Config.all_channels/0 and Config.channel_modules/1 logic into State; add State.add_loaded_module/2
The problem:

When we're going through the list of modules to send messages to based
on the channels they're a part of, it was being done so through the
config. Since the config doesn't (and shouldn't) list all of the core
modules that get included, any core modules that were loaded and running
under the ModuleSupervisor would not get included in the router's
attempt to send messages to a module.

Now, the Config.all_channels and Config.channel_modules functions live
in State, and State has a new "add_loaded_module" function where loaded
modules are registered. The aforementioned moved functions will use this
as the "source of truth" when deciding where to send messages for
modules to handle.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-06-13 17:13:05 -04:00
73c5f58243 WIP: Move to using modules for implementing core behavior
Since modules can now intercept all messages in the channels they're
listening for, it'd be cool to have modules handling things like making
sure the Omnibot.State stays updated as appropriate, and that pings are
ponged, etc.

This will probably deprecate the router, since it's been reduced to a
single function call, but we'll see about that.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-06-13 16:04:19 -04:00
6340936895 Initial commit with IRC and bot example.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-06-12 17:29:35 -04:00