From: Matt Mullins Date: Tue, 9 Sep 2014 06:24:35 +0000 (-0700) Subject: irc: responses are sent with NOTICE, not PRIVMSG X-Git-Tag: v15~10 X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=2ea0a08303edc81c03de1621ba40634bb178b4d2;p=erlbot.git irc: responses are sent with NOTICE, not PRIVMSG --- 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);