TelegramBot/bot_script.pl

27 lines
365 B
Perl
Raw Normal View History

2023-11-12 18:12:26 +01:00
#/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;