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,5 +1,4 @@
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
@@ -26,7 +25,6 @@ defmodule Omnibot.Plugin.Base do
def commands(), do: MapSet.to_list(@commands) def commands(), do: MapSet.to_list(@commands)
end end
end end
end
defmacro __using__([]) do defmacro __using__([]) do
quote do quote do
@@ -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