From 2ea0a08303edc81c03de1621ba40634bb178b4d2 Mon Sep 17 00:00:00 2001 From: Matt Mullins Date: Mon, 8 Sep 2014 23:24:35 -0700 Subject: [PATCH] irc: responses are sent with NOTICE, not PRIVMSG --- irc/irc_amqp_listener.erl | 2 +- irc/irc_command.erl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/irc/irc_amqp_listener.erl b/irc/irc_amqp_listener.erl index ffcfcfd..a10f2db 100644 --- a/irc/irc_amqp_listener.erl +++ b/irc/irc_amqp_listener.erl @@ -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), diff --git a/irc/irc_command.erl b/irc/irc_command.erl index 4f37cc7..3621d5f 100644 --- a/irc/irc_command.erl +++ b/irc/irc_command.erl @@ -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); -- 2.11.0