From d6c78daf2146de4616f5afd5da8da5b9cc5223a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20H=C3=A4rter?= Date: Sun, 12 Nov 2023 18:12:26 +0100 Subject: [PATCH] Added script for initiating bot. --- bot_script.pl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 bot_script.pl diff --git a/bot_script.pl b/bot_script.pl new file mode 100644 index 0000000..ed7fc78 --- /dev/null +++ b/bot_script.pl @@ -0,0 +1,26 @@ +#/usr/bin/perl + +use v5.32; + +use strict; +use warnings; + +use FindBin; +use YAML; + +my $Conf; +BEGIN { $Conf = YAML::LoadFile("$FindBin::Bin/.bot.cnf"); } + +if ( !$Conf->%* ) { + print STDERR "No valid config was found. Exiting...\n"; + exit; +} + +use lib $Conf->{Lib}; + +use TelegramBot; + +my $BotObject = TelegramBot->new($Conf->%*); +$BotObject->fetchMessages(); + +exit;