summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPaul Schoenfelder <paulschoenfelder@gmail.com>2016-03-08 10:45:21 -0600
committerPaul Schoenfelder <paulschoenfelder@gmail.com>2016-03-08 10:45:21 -0600
commit37a5193184e706a4f06f3a537a8d6fe36e59a5c6 (patch)
tree3522e8cdd8c45de5b4457bf92aa5cd18370cad39 /examples
parentMerge remote-tracking branch 'annwenn/userinfo' (diff)
A few cleanup tasks, tweaks to the docs/examples
Diffstat (limited to 'examples')
-rw-r--r--examples/bot/lib/bot.ex6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/bot/lib/bot.ex b/examples/bot/lib/bot.ex
index e73bb4c..46dd6b6 100644
--- a/examples/bot/lib/bot.ex
+++ b/examples/bot/lib/bot.ex
@@ -70,11 +70,11 @@ defmodule Example.Bot do
Logger.info "Users logged in to #{channel}:\n#{names}"
{:noreply, config}
end
- def handle_info({:received, msg, nick, channel}, config) do
+ def handle_info({:received, msg, %SenderInfo{:nick => nick}, channel}, config) do
Logger.info "#{nick} from #{channel}: #{msg}"
{:noreply, config}
end
- def handle_info({:mentioned, msg, nick, channel}, config) do
+ def handle_info({:mentioned, msg, %SenderInfo{:nick => nick}, channel}, config) do
Logger.warn "#{nick} mentioned you in #{channel}"
case String.contains?(msg, "hi") do
true ->
@@ -86,7 +86,7 @@ defmodule Example.Bot do
end
{:noreply, config}
end
- def handle_info({:received, msg, nick}, config) do
+ def handle_info({:received, msg, %SenderInfo{:nick => nick}}, config) do
Logger.warn "#{nick}: #{msg}"
reply = "Hi!"
Client.msg config.client, :privmsg, nick, reply