[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug command



I've written a 'bug' command that lets you report infobot bugs and
have them mailed to a suitable address. Add the attached file to the
src dir and apply the patch to implement it.

Bug.pl

diff -u --exclude=CVS -b -r infobot/files/infobot.config /home/mstevens/src/perl/infobot/files/infobot.config
--- infobot/files/infobot.config	Wed Feb  9 12:50:22 2000
+++ /home/mstevens/src/perl/infobot/files/infobot.config	Mon Feb 21 14:17:01 2000
@@ -215,3 +215,5 @@
 # exchange rates (exchange 233 DEM to USD)
 exchange true
 
+bug yes
+bugAdmin michael@etla.org
diff -u --exclude=CVS -b -r infobot/src/Extras.pl /home/mstevens/src/perl/infobot/src/Extras.pl
--- infobot/src/Extras.pl	Wed Feb  9 12:50:22 2000
+++ /home/mstevens/src/perl/infobot/src/Extras.pl	Mon Feb 21 13:57:47 2000
@@ -798,9 +798,31 @@
 	return 'NOREPLY';
     }				# end excuse
 
+    if (getparam('bug') and ($message =~ /^\s*bug(.*)$/i) and (!$no_bug)) {
+      if ($1 !~ /^\s*$/) { 
+        my $ret = &bug($who, $message);
+        if ($msgType eq 'public') {
+          &say($ret);
+        } else {
+          &msg($who, $ret);
+        }
+      } else {
+        if ($msgType eq 'public') {
+	  &say("No bug!");
+        } else {
+	  &msg($who, "No bug!");
+	}
+      } 
+      return 'NOREPLY';
+    }
     return undef;
 }
 
 
 1;
 
+
+
+
+
+