mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 05:49:27 +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 Time::Duration qw/duration/;
|
||||||
use Fcntl qw(:flock);
|
use Fcntl qw(:flock);
|
||||||
|
|
||||||
|
use lib ".";
|
||||||
|
|
||||||
use IRCColors;
|
use IRCColors;
|
||||||
use QStatskeeper;
|
use QStatskeeper;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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";
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
use warnings;
|
use warnings;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
|
use lib ".";
|
||||||
|
|
||||||
use IRCColors;
|
use IRCColors;
|
||||||
use QStatskeeper;
|
use QStatskeeper;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user