Update modules to be more egonomic, add command macro
Modules are now defined using on_{msg,channel_msg,join,part,kick}.
Additionally, commands can be defined using a convenient macro.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -33,7 +33,7 @@ defmodule Omnibot.Router do
|
||||
# Find modules that want this message
|
||||
State.cfg()
|
||||
|> Config.channel_modules(channel)
|
||||
|> Enum.each(fn {module, _} -> module.msg(module, msg) end)
|
||||
|> Enum.each(fn {module, _} -> module.on_msg(msg) end)
|
||||
end
|
||||
|
||||
def handle(_irc, :join, %Msg {prefix: %Msg.Prefix{nick: nick}, params: [channel | _]}) do
|
||||
|
||||
Reference in New Issue
Block a user