diff --git a/.gitignore b/.gitignore index ce4da59..b648862 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,5 @@ inc/ /pm_to_blib /*.zip +# SQLite +*.sqlite \ No newline at end of file diff --git a/main.pl b/main.pl index 677fc94..3a67d40 100755 --- a/main.pl +++ b/main.pl @@ -7,6 +7,9 @@ use DBI; # Config my $url = 'paste webhook URL here'; +my $rolePing = 0; # 0 = don't ping at all, 1 = ping role ID specified in $roleID, 2 = everyone +my $roleID = 0; + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my @month_name = qw(January February March April May June July August September October November December); $year += 1900; @@ -40,6 +43,13 @@ else { 'color' => rand 16777215 }); + if ($rolePing > 0) { + if ($rolePing == 1) { + $webhook->execute( content => '<@&' . $roleID . '>' ); + } elsif ($rolePing == 2) { + $webhook->execute( content => '@everyone' ); + }}; + if ($#questions == 0) { $webhook->execute( content => '**You\'re out of questions!** Please add more or no question will be posted tomorrow.'); $dbh->disconnect; warn "Last available question used, finished"