Actually remove Hooks from Plugin.Base - forgot to add this two commits

ago oopz

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-07-09 14:50:49 -07:00
parent 06847b0028
commit 010d60f4f9

View File

@@ -1,30 +1,28 @@
defmodule Omnibot.Plugin.Base do defmodule Omnibot.Plugin.Base do
defmodule Hooks do defmacro __before_compile__(_env) do
defmacro __before_compile__(_env) do quote generated: true do
quote generated: true do @impl true
@impl true def on_channel_msg(_irc, _channel, _nick, _line), do: nil
def on_channel_msg(_irc, _channel, _nick, _line), do: nil
@impl true @impl true
def on_channel_msg(_irc, _channel, _nick, _cmd, _params), do: nil def on_channel_msg(_irc, _channel, _nick, _cmd, _params), do: nil
@impl true @impl true
def on_join(_irc, _channel, _nick), do: nil def on_join(_irc, _channel, _nick), do: nil
@impl true @impl true
def on_part(_irc, _channel, _nick), do: nil def on_part(_irc, _channel, _nick), do: nil
@impl true @impl true
def on_kick(_irc, _channel, _nick, _target), do: nil def on_kick(_irc, _channel, _nick, _target), do: nil
@impl true @impl true
def on_init(_cfg), do: nil def on_init(_cfg), do: nil
@impl true @impl true
def default_config(), do: @default_config def default_config(), do: @default_config
def commands(), do: MapSet.to_list(@commands) def commands(), do: MapSet.to_list(@commands)
end
end end
end end
@@ -37,8 +35,6 @@ defmodule Omnibot.Plugin.Base do
@impl Plugin.Base @impl Plugin.Base
def on_msg(irc, msg) do def on_msg(irc, msg) do
# TODO - instead of using a router for plugins, consider using a PubSub with a Registry:
# https://hexdocs.pm/elixir/master/Registry.html#module-using-as-a-pubsub
route_msg(irc, msg) route_msg(irc, msg)
end end
@@ -79,7 +75,7 @@ defmodule Omnibot.Plugin.Base do
@commands MapSet.new() @commands MapSet.new()
@default_config [] @default_config []
@before_compile Omnibot.Plugin.Base.Hooks @before_compile Omnibot.Plugin.Base
end end
end end