summaryrefslogtreecommitdiff
path: root/lib/lsg_irc/correction_plugin.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lsg_irc/correction_plugin.ex')
-rw-r--r--lib/lsg_irc/correction_plugin.ex8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/lsg_irc/correction_plugin.ex b/lib/lsg_irc/correction_plugin.ex
index e7b2577..f370cf8 100644
--- a/lib/lsg_irc/correction_plugin.ex
+++ b/lib/lsg_irc/correction_plugin.ex
@@ -7,12 +7,12 @@ defmodule LSG.IRC.CorrectionPlugin do
def irc_doc, do: @moduledoc
def start_link() do
- GenServer.start_link(__MODULE__, [])
+ GenServer.start_link(__MODULE__, [], name: __MODULE__)
end
def init(_) do
- {:ok, _} = Registry.register(IRC.PubSub, "message", [])
- {:ok, _} = Registry.register(IRC.PubSub, "triggers", [])
+ {:ok, _} = Registry.register(IRC.PubSub, "message", [plugin: __MODULE__])
+ {:ok, _} = Registry.register(IRC.PubSub, "triggers", [plugin: __MODULE__])
{:ok, %{}}
end
@@ -25,7 +25,7 @@ defmodule LSG.IRC.CorrectionPlugin do
{:noreply, correction(m, state)}
end
- defp correction(m, state) do
+ def correction(m, state) do
history = Map.get(state, key(m), [])
if String.starts_with?(m.text, "s/") do
case String.split(m.text, "/") do