Current section

Files

Jump to
soulless lib soulless handler handler.ex
Raw

lib/soulless/handler/handler.ex

defmodule Soulless.Handler do
@callback handle_ready(client :: pid(), state :: :connected | :authenticated) :: any()
@callback handle_notice(client :: pid(), notice :: struct()) :: any()
defmacro __using__(_opts) do
quote do
@behaviour Soulless.Handler
@impl Soulless.Handler
def handle_ready(_pid, _state) do
:ok
end
@impl Soulless.Handler
def handle_notice(_pid, _notice) do
:ok
end
defoverridable handle_ready: 2,
handle_notice: 2
end
end
end