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:
parent
1dd476d4f2
commit
8e37cb1370
@ -11,6 +11,8 @@ use Time::HiRes qw/gettimeofday/;
|
||||
use Time::Duration qw/duration/;
|
||||
use Fcntl qw(:flock);
|
||||
|
||||
use lib ".";
|
||||
|
||||
use IRCColors;
|
||||
use QStatskeeper;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -10,6 +10,8 @@ use strict;
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
use Time::Duration qw(concise duration);
|
||||
|
||||
use lib ".";
|
||||
|
||||
use Scorekeeper;
|
||||
use IRCColors;
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
use lib ".";
|
||||
|
||||
use IRCColors;
|
||||
use QStatskeeper;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user