10 Commits

Author SHA1 Message Date
a3e4a088b3 Add Omnibot.Plugin.Base.on_connect/1 callback
This new callback gets called immediately upon connecting to the server.
It is automatically implemented as a no-op by default.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-08-12 15:31:40 -07:00
accfc2a7fe Remove old TODO
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-08-11 15:43:43 -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
715480230a Remove Omnibot.State.cfg/0 from Omnibot.Irc module
Deprecating Omnibot.State: IRC module holds its own configuration now.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-08-11 12:48:28 -07:00
ec1dd42ca1 Fix routing bug in IRC and base plugin
Previously, messages were only routed from IRC if they were *not* for
the current user. This should only be happening for privmsg messages,
since a plugin is generally aware of what it's sending out.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-07-18 14:09:17 -07:00
d2a1cb541d Change message routing logic to be an implication instead of AND
Previously, a message wouldn't be admitted if it didn't have a prefix,
(logical) AND if the message was equal to the bot's nickname.

Now, a message with a blank prefix passes through, but if the prefix is
the bot's nickname, it does not.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-07-17 22:14:40 -07:00
b72071793b Remove unnecessary kruft
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-07-17 22:14:33 -07:00
bb8ebca0b8 IRC messages are not routed if they are sent by the bot
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-07-16 18:00:43 -07:00
9679c46e15 WIP: Supervisor-based plugin base
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-07-12 12:19:14 -07:00
96c5ed78cf Rename lib/irc.ex -> lib/irc/irc.ex
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-07-02 18:49:48 -07:00