Permalink
Browse files

Add a check to make sure the content of the reply is non-empty

  • Loading branch information...
1 parent ce1a4e6 commit fb9be489de0d2e215ec11d35f7d5086975651642 Ben Cotton committed May 2, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 ttytter-r2a.pl
View
@@ -25,6 +25,12 @@
my $tweet = &get_tweet($tweet_id);
my $witty_reply = $command[2];
+ # Is the witty reply empty? Don't tweet it, that's obnoxious.
+ if ( $witty_reply eq '' ) {
+ print $stdout "-- There is no message here. Are you drunk?\n";
+ return 1;
+ }
+
# Check that the tweet exists. If not, it will be hard to reply to it.
if (!$tweet->{'id_str'}) {
print $stdout "-- You have to wait for that tweet to exist!\n";

0 comments on commit fb9be48

Please sign in to comment.