Issue #1: Initiator script now using config file.
This commit is contained in:
		@@ -5,9 +5,22 @@ use v5.32;
 | 
				
			|||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
use warnings;
 | 
					use warnings;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use lib '/home/demiguise/telegram_bot';
 | 
					use FindBin;
 | 
				
			||||||
 | 
					use YAML;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					my $Conf;
 | 
				
			||||||
 | 
					BEGIN { $Conf = YAML::LoadFile("$FindBin::Bin/.f1bot.cnf"); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if ( !$Conf->%* ) {
 | 
				
			||||||
 | 
					    print STDERR "No valid config was found. Exiting...\n";
 | 
				
			||||||
 | 
					    exit;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use lib $Conf->{Lib};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use F1DataBot;
 | 
					use F1DataBot;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
my $F1DataBotObject = F1DataBot->new();
 | 
					my $F1DataBotObject = F1DataBot->new($Conf->%*);
 | 
				
			||||||
$F1DataBotObject->fetchMessages();
 | 
					$F1DataBotObject->fetchMessages();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					exit;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user