1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 23:25:42 -04:00

Updates for colors

This commit is contained in:
Ryan Voots 2017-03-03 22:09:27 -05:00
parent c332e3389a
commit 3f78422223

View file

@ -2,7 +2,7 @@ package Bot::BB3::Plugin::Factoids;
use DBI; use DBI;
use DBD::SQLite; use DBD::SQLite;
use DBD::SQLite::BundledExtensions; use DBD::SQLite::BundledExtensions;
use POE::Component::IRC::Common qw/l_irc/; use IRC::Utils qw/lc_irc strip_color strip_formatting/;
use Text::Metaphone; use Text::Metaphone;
use strict; use strict;
@ -274,6 +274,9 @@ sub handle {
my $prefix = $conf->{prefix_command}; my $prefix = $conf->{prefix_command};
return unless $prefix; return unless $prefix;
# TODO make this channel configurable and make it work properly to learn shit with colors later.
$said->{body} = strip_formatting strip_color $said->{body};
if ($said->{body} =~ /^\Q$prefix\E(?<fact>[^@]*?)(?:\s@\s*(?<user>\S*)\s*)?$/ || if ($said->{body} =~ /^\Q$prefix\E(?<fact>[^@]*?)(?:\s@\s*(?<user>\S*)\s*)?$/ ||
$said->{body} =~ /^\Q$prefix\E!@(?<user>\S+)\s+(?<fact>.+)$/) { $said->{body} =~ /^\Q$prefix\E!@(?<user>\S+)\s+(?<fact>.+)$/) {
my $fact = $+{fact}; my $fact = $+{fact};
@ -384,7 +387,7 @@ sub _insert_factoid {
$subject, $subject,
$copula, $copula,
$predicate, $predicate,
l_irc($author), lc_irc($author),
time, time,
Metaphone($key), Metaphone($key),
$compose_macro || 0, $compose_macro || 0,