More things need to be added to Omnibot.Core's state, so it's been
expanded to a map to allow for that.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* using Plugin.GenServer now uses Plugin.Base so that is not required
* Remove Omnibot.Plugin because all it did was include Plugin.GenServer
and Plugin.Base
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
- Using the @default_config attribute in a module will fill out a default
value.
- cfg[:timeout] sets the timeout for the task for this module to finish.
- Update Omnibot.Irc.route_msg/2 to have each task spawn a second task,
while the first task waits for its child to finish, otherwise killing
it.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Present rooms are tracked by Omnibot.Core now, instead of
Omnibot.State
* Channel synchronization is done through Omnibot.Core instead of
Omnibot.Irc
* Add Omnibot.Module.on_init/1 callback, which returns a "state" value
for the module to keep track of. By default, the state is nil.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Previously, core behavior was handled in the Omnibot.Router module.
However, since the module system is robust enough, this work has been
delegated to the Omnibot.Core module.
Additionally, the Omnibot.State module has been augmented to keep track
of the modules that have been currently loaded, and methods that are
used to get the list of loaded modules and routing information for those
modules are coming from Omnibot.State as well (as opposed to
Omnibot.Config). This is to avoid requiring the Omnibot.Core module be
included in the config, plus avoiding modification of the runtime config
after it has already been loaded.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>