From 629b3406acf79b72027e1e1176da9aeec6b01023 Mon Sep 17 00:00:00 2001 From: swag Date: Thu, 21 Jul 2022 23:58:41 -0400 Subject: [PATCH] Check for presence of the webhook URL dotfile --- guestbook-ng.pl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/guestbook-ng.pl b/guestbook-ng.pl index 4bc21f1..a065789 100755 --- a/guestbook-ng.pl +++ b/guestbook-ng.pl @@ -9,7 +9,7 @@ use List::Util qw{shuffle}; use Regexp::Common qw{URI}; use Number::Format qw{format_number}; use WebService::Discord::Webhook; -#use Data::Dumper; # Uncomment for debugging +use Data::Dumper; # Uncomment for debugging # Load the model use lib 'lib'; @@ -85,9 +85,16 @@ any [qw{GET POST}], '/sign' => sub ($c) { $c->stash(status => 400) } else { - $c->message->create_post($name, $message, $url, $spam); + my $blah = + $c->message->create_post($name, $message, $url, $spam); + say Dumper $blah; - $c->flash(error => 'This message was flagged as spam') if $spam; + if ($spam) { + $c->flash(error => 'This message was flagged as spam') + } + elsif (-s '.tom.url') { + say 'do stuff here...' + } return $c->redirect_to(page => {page => 'view'}); }