mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 23:45:41 -04:00
Updates for colors
This commit is contained in:
parent
c332e3389a
commit
3f78422223
1 changed files with 6 additions and 3 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue