Skip to content

Commit

Permalink
Removed random signature
Browse files Browse the repository at this point in the history
  • Loading branch information
dnet committed Jun 12, 2010
1 parent e445eca commit 85e2741
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions ircbot.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
-define(DEFAULT_PORT, 6667).
-define(NICK, "jimm-erlang-bot").
-define(FULL_NAME, "Jim's Erlang Bot").
-define(RANDOM_SIG_SCRIPT, "/Users/jimm/src/src/bin/randomSig.rb").
-define(RANDOM_SIG_ERROR, "Random sig not found. Sorry about that.").

start() ->
start("#jimm-test").
Expand Down Expand Up @@ -84,18 +82,11 @@ process_privmsg(Message, ReplyTo) ->
%% Handle particular messages
process_privmsg("hello", _Remainder, ReplyTo) ->
{ok, "PRIVMSG " ++ ReplyTo ++ " :Well, hello to you too!"};
process_privmsg("sig", _Remainder, ReplyTo) ->
{ok, "PRIVMSG " ++ ReplyTo ++ " :" ++ random_sig()};
process_privmsg("quit", _Remainder, _ReplyTo) ->
{quit, "QUIT :Goodbye from " ++ ?NICK};
process_privmsg(_, _, _) ->
noreply.

random_sig() ->
String = os:cmd(?RANDOM_SIG_SCRIPT),
{ok, Sig, _N} = regexp:gsub(String, "\n", " "),
Sig.

quit(Socket, QuitCommand) ->
send(Socket, QuitCommand),
gen_tcp:close(Socket),
Expand Down

0 comments on commit 85e2741

Please sign in to comment.