commit b8d800b81cd3af0db4ec48a50e26531b81066e23
parent 4236ee7a4f84626a5ae6ecdc54eb58967ee5db44
Author: noodle <noodle@pastanoggin.com>
Date: Fri, 7 Nov 2025 00:02:52 +0000
add allah command (quran and bible api's by prahou. thank you!)
Diffstat:
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/mata_bot.pl b/mata_bot.pl
@@ -8,7 +8,8 @@ use IO::Socket qw(AF_INET SOCK_STREAM);
use IO::Socket::SSL;
use POSIX qw(strftime);
-my $BIBLE_VERSES = 31102;
+my $NVERSES_BIBLE = 31102;
+my $NVERSES_QURAN = 6348;
my $CHUNK_LENGTH = 512;
my $CONNECT_TIMEOUT = 60;
my $RECONNECT_TIME = 60;
@@ -104,9 +105,15 @@ sub respond_command {
yo+
)\b{wb}/ix) {
$reply = "$hellos->[rand @$hellos], ${sender_nick}! ${MATA_HAPPY}"
- } elsif ($content =~ /g[o-]d+/i) {
- my $response = HTTP::Tiny->new->get("http://triapul.cz/files/bible/@{[randint(1, $BIBLE_VERSES)]}");
- $reply = "God is Dead!! ${MATA_CUTE}";
+ } elsif ($content =~ /(a+l{2,}a+h|g[o-]d)/i) {
+ my $response;
+ if ($1 =~ /^a/) {
+ $response = HTTP::Tiny->new->get("http://triapul.cz/files/quran/@{[randint(1, $NVERSES_QURAN)]}");
+ $reply = "Allah will not answer prayers until server fixes it's polytheist ways!! ${MATA_CUTE}";
+ } else {
+ $response = HTTP::Tiny->new->get("http://triapul.cz/files/bible/@{[randint(1, $NVERSES_BIBLE)]}");
+ $reply = "God is Dead!! ${MATA_CUTE}";
+ }
if ($response->{success}) {
my $body = $response->{content};
$body =~ tr/\000\r\n//d;