summaryrefslogtreecommitdiff
path: root/lib/exirc/example_handler.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/exirc/example_handler.ex')
-rw-r--r--lib/exirc/example_handler.ex12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/exirc/example_handler.ex b/lib/exirc/example_handler.ex
index 48774fd..1701729 100644
--- a/lib/exirc/example_handler.ex
+++ b/lib/exirc/example_handler.ex
@@ -27,10 +27,10 @@ defmodule ExampleHandler do
def handle_info(:logged_in, _state) do
IO.puts "Logged in!"
end
- def handle_info(%IrcMessage{nick: from, cmd: "PRIVMSG", args: ["mynick", msg]}, _state) do
+ def handle_info(%ExIRC.Message{nick: from, cmd: "PRIVMSG", args: ["mynick", msg]}, _state) do
IO.puts "Received a private message from \#{from}: \#{msg}"
end
- def handle_info(%IrcMessage{nick: from, cmd: "PRIVMSG", args: [to, msg]}, _state) do
+ def handle_info(%ExIRC.Message{nick: from, cmd: "PRIVMSG", args: [to, msg]}, _state) do
IO.puts "Received a message in \#{to} from \#{from}: \#{msg}"
end
"""
@@ -110,18 +110,18 @@ defmodule ExampleHandler do
debug "* #{from} #{message} in #{channel}"
{:noreply, nil}
end
- # This is an example of how you can manually catch commands if ExIrc.Client doesn't send a specific message for it
- def handle_info(%IrcMessage{nick: from, cmd: "PRIVMSG", args: ["testnick", msg]}, _state) do
+ # This is an example of how you can manually catch commands if ExIRC.Client doesn't send a specific message for it
+ def handle_info(%ExIRC.Message{nick: from, cmd: "PRIVMSG", args: ["testnick", msg]}, _state) do
debug "Received a private message from #{from}: #{msg}"
{:noreply, nil}
end
- def handle_info(%IrcMessage{nick: from, cmd: "PRIVMSG", args: [to, msg]}, _state) do
+ def handle_info(%ExIRC.Message{nick: from, cmd: "PRIVMSG", args: [to, msg]}, _state) do
debug "Received a message in #{to} from #{from}: #{msg}"
{:noreply, nil}
end
# Catch-all for messages you don't care about
def handle_info(msg, _state) do
- debug "Received IrcMessage:"
+ debug "Received ExIRC.Message:"
IO.inspect msg
{:noreply, nil}
end