3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 11:59:43 +01:00

Fix C Jeopardy @INC; and some minor filter tweaks

This commit is contained in:
Pragmatic Software 2018-03-12 08:52:43 -07:00
parent 1dd476d4f2
commit 8e37cb1370
7 changed files with 15 additions and 3 deletions

View File

@ -11,6 +11,8 @@ use Time::HiRes qw/gettimeofday/;
use Time::Duration qw/duration/;
use Fcntl qw(:flock);
use lib ".";
use IRCColors;
use QStatskeeper;

View File

@ -12,6 +12,8 @@ use Time::HiRes qw(gettimeofday);
use Time::Duration qw(duration concise);
use Fcntl qw(:flock);
use lib ".";
use QStatskeeper;
use Scorekeeper;
use IRCColors;

View File

@ -25,7 +25,7 @@ if ($channel !~ /^#/) {
if (not length $filter) {
my $ret = open my $fh, '<', "$CJEOPARDY_FILTER-$channel";
if (not defined $ret) {
print "There is no filter active for $channel. Usage: filter <comma or space separated list of words> or `filter clear` to clear.\n";
print "There is no filter active for $channel. Usage: filter <comma separated list of words> or `filter clear` to clear.\n";
exit;
}
@ -34,7 +34,7 @@ if (not length $filter) {
chomp $words;
$words =~ s/,/, /g;
$words =~ s/, ([^,]+)$/ or $1/;
print "Filter active. Questions containing $words will be skipped. Usage: filter <comma or space separated list of words> or `filter clear` to clear.\n";
print "Filter active. Questions containing $words will be skipped. Usage: filter <comma separated list of words> or `filter clear` to clear.\n";
exit;
}
@ -50,7 +50,7 @@ if ($filter eq 'clear') {
}
$filter =~ s/(^\s+|\s+$)//g;
my @words = split /[ ,]+/, $filter;
my @words = split /\s*,\s*/, $filter;
if (not @words) {
print "What?\n";

View File

@ -11,6 +11,8 @@ use Time::HiRes qw/gettimeofday/;
use Time::Duration qw/duration/;
use Fcntl qw(:flock);
use lib ".";
use Scorekeeper;
use QStatskeeper;
use IRCColors;

View File

@ -11,6 +11,8 @@ use Time::HiRes qw(gettimeofday);
use Time::Duration qw(duration concise);
use POSIX 'strftime';
use lib ".";
use QStatskeeper;
my $command = shift @ARGV;

View File

@ -10,6 +10,8 @@ use strict;
use Time::HiRes qw(gettimeofday);
use Time::Duration qw(concise duration);
use lib ".";
use Scorekeeper;
use IRCColors;

View File

@ -7,6 +7,8 @@
use warnings;
use strict;
use lib ".";
use IRCColors;
use QStatskeeper;