irc: responses are sent with NOTICE, not PRIVMSG
authorMatt Mullins <mmullins@mmlx.us>
Tue, 9 Sep 2014 06:24:35 +0000 (23:24 -0700)
committerMatt Mullins <mmullins@mmlx.us>
Tue, 9 Sep 2014 06:24:35 +0000 (23:24 -0700)
irc/irc_amqp_listener.erl
irc/irc_command.erl

index ffcfcfd..a10f2db 100644 (file)
@@ -56,7 +56,7 @@ handle_info(
     [_, _, DestinationKey] = string:tokens(binary_to_list(RoutingKey), "."),
     Destination = decode_routing_key(DestinationKey),
     Content = binary_to_list(BinContent),
-    Command = #irc_command{ command = "PRIVMSG",
+    Command = #irc_command{ command = "NOTICE",
                             middles = [ Destination ],
                             trailing = Content },
     irc_conn:send_command(ConnectionPid, Command),
index 4f37cc7..3621d5f 100644 (file)
@@ -12,13 +12,13 @@ do_privmsg_command(Text, From) ->
         "botsnack" ->
             Choices = {"*chomp*", ":P", "yay", "meh", "\\o/"},
             Index = random:uniform(size(Choices)),
-            NewCommand = #irc_command{command = "PRIVMSG",
+            NewCommand = #irc_command{command = "NOTICE",
                                       middles = [From],
                                       trailing = element(Index, Choices)},
             irc_conn:send_command(self(), NewCommand);
         "random" ++ Choices ->
             Response = random_choice(Choices),
-            NewCommand = #irc_command{command = "PRIVMSG",
+            NewCommand = #irc_command{command = "NOTICE",
                                       middles = [From],
                                       trailing = Response},
             irc_conn:send_command(self(), NewCommand);