3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02: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 Time::Duration qw/duration/;
use Fcntl qw(:flock); use Fcntl qw(:flock);
use lib ".";
use IRCColors; use IRCColors;
use QStatskeeper; use QStatskeeper;

View File

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

View File

@ -25,7 +25,7 @@ if ($channel !~ /^#/) {
if (not length $filter) { if (not length $filter) {
my $ret = open my $fh, '<', "$CJEOPARDY_FILTER-$channel"; my $ret = open my $fh, '<', "$CJEOPARDY_FILTER-$channel";
if (not defined $ret) { 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; exit;
} }
@ -34,7 +34,7 @@ if (not length $filter) {
chomp $words; chomp $words;
$words =~ s/,/, /g; $words =~ s/,/, /g;
$words =~ s/, ([^,]+)$/ or $1/; $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; exit;
} }
@ -50,7 +50,7 @@ if ($filter eq 'clear') {
} }
$filter =~ s/(^\s+|\s+$)//g; $filter =~ s/(^\s+|\s+$)//g;
my @words = split /[ ,]+/, $filter; my @words = split /\s*,\s*/, $filter;
if (not @words) { if (not @words) {
print "What?\n"; print "What?\n";

View File

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

View File

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

View File

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

View File

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