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>
12 lines
207 B
Elixir
12 lines
207 B
Elixir
defmodule Omnibot.Core.Join do
|
|
use Omnibot.Module
|
|
alias Omnibot.State
|
|
|
|
def on_join(channel, nick) do
|
|
cfg = State.cfg()
|
|
if nick == cfg.nick do
|
|
State.add_channel(channel)
|
|
end
|
|
end
|
|
end
|