Commit Graph

7 Commits

Author SHA1 Message Date
7b88d861fe Update Plugins to keep a reference to the Bot object instead of server_config
Plugins now use Bots instead of server_configs, this is useful for
checking the currently joined channels and perhaps using the connection
when there isn't one available in the current method.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-30 17:03:28 -07:00
de477210b1 Add on_connect callback and joined_channels property
* on_connect is called on all plugins on the first message received from
  the IRC server
* joined_channels property gets all of the channels that this bot has
  currently joined in IRC

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-30 16:31:01 -07:00
585f9e5952 Add "enabled" config option
If a plugin has enabled = false, it will not load.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-26 19:47:30 -07:00
f0cfe53c8e Add on_load for plugins
This asynchronous function is called on all plugins right before the IRC
connection is made.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-26 19:06:48 -07:00
82e50f86d6 Add graceful exits
This sets up a set of ropes and pulleys that signal the `Bot.keepalive`
function to clean things up after a quit signal has been sent. This
allows plugins to define an `on_unload` function to save any important
datas on intentional exit.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-24 19:16:15 -07:00
cf770af2ff Add log messages for join, part, and kick
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-23 19:00:38 -07:00
a901c2351a Initial commit with functional framework(!) and example plugin
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-05-23 18:47:28 -07:00