Use latest guestbook

This commit is contained in:
swagg boi 2021-05-02 19:07:50 -04:00
parent b75df77065
commit 164258d02a

View file

@ -134,20 +134,28 @@ sub params_in {
} }
# Variable set for banned user # Variable set for banned user
my $ban; my ($ban, $trigger);
# Parse the banned names list # Parse the banned names list
chomp(my @nameBan = <$nameBans>); chomp(my @nameBan = <$nameBans>);
for (@nameBan) { for (@nameBan) {
last if $ban; last if $ban;
$ban = 1 if $name =~ /$_/;
if ($name =~ /$_/i) {
$ban = 1;
$trigger = $_;
}
} }
# Parse the banned phrases list # Parse the banned phrases list
chomp(my @thoughtCrime = <$thoughtCrimes>); chomp(my @thoughtCrime = <$thoughtCrimes>);
for (@thoughtCrime) { for (@thoughtCrime) {
last if $ban; last if $ban;
$ban = 1 if $message =~ /$_/;
if ($message =~ /$_/i) {
$ban = 1;
$trigger = $_;
}
} }
# Send it unless ban is true; else send it to spam if spam chan is # Send it unless ban is true; else send it to spam if spam chan is
@ -159,11 +167,13 @@ sub params_in {
message => "$name from $location says: $message" message => "$name from $location says: $message"
} }
); );
} elsif ($spam) { }
elsif ($spam) {
$resource->create( $resource->create(
{ {
channel_id => "$spam", channel_id => "$spam",
message => "$name from $location says: $message" message => "$name from $location says: $message\n\n" .
"Spam trigger: `$trigger`"
} }
); );
} }