Switched to object usage of f1 perl libary.
Accepted perltidy suggestions.
This commit is contained in:
		
							
								
								
									
										411
									
								
								F1DataBot.pm
									
									
									
									
									
								
							
							
						
						
									
										411
									
								
								F1DataBot.pm
									
									
									
									
									
								
							| @@ -1,12 +1,17 @@ | |||||||
| #!/usr/bin/perl |  | ||||||
|  |  | ||||||
| # Important for switch feature | # Important for switch feature | ||||||
| use v5.34; | use v5.34; | ||||||
|  |  | ||||||
|  | use utf8; | ||||||
| use strict; | use strict; | ||||||
| use warnings; | use warnings; | ||||||
|  |  | ||||||
|  | no warnings qw(experimental); | ||||||
|  |  | ||||||
|  | # core packages | ||||||
|  | use Encode; | ||||||
|  |  | ||||||
| # CPAN packages | # CPAN packages | ||||||
|  | use JSON; | ||||||
| use Log::Log4perl; | use Log::Log4perl; | ||||||
|  |  | ||||||
| # Package name | # Package name | ||||||
| @@ -14,161 +19,321 @@ package F1DataBot; | |||||||
|  |  | ||||||
| # Constants and initalisations | # Constants and initalisations | ||||||
| Log::Log4perl->init('log.conf'); | Log::Log4perl->init('log.conf'); | ||||||
| my $ERGAST_URL   = 'http://ergast.com/api/f1'; |  | ||||||
| my $TELEGRAM_URL = 'https://api.telegram.org'; | sub new { | ||||||
| my $TOKEN        = 'bot5868933096:AAE8Oe-AxU6m_yCWfpqTqwwjERqnRpBGJtE'; |     my ( $Type, %Param ) = @_; | ||||||
|  |  | ||||||
|  |     # allocate new hash for object | ||||||
|  |     my $Self = {}; | ||||||
|  |     bless( $Self, $Type ); | ||||||
|  |  | ||||||
|  |     $Self->{LogLevel}  = $Param{LogLevel} || 'info'; | ||||||
|  |     $Self->{LogObject} = Log::Log4perl->get_logger('F1DataBot'); | ||||||
|  |     $Self->{Token}     = 'bot5868933096:AAE8Oe-AxU6m_yCWfpqTqwwjERqnRpBGJtE'; | ||||||
|  |     $Self->{URL}       = { | ||||||
|  |         Ergast   => 'http://ergast.com/api/f1', | ||||||
|  |         Telegram => 'https://api.telegram.org', | ||||||
|  |     }; | ||||||
|  |  | ||||||
|  |     return $Self; | ||||||
|  | } | ||||||
|  |  | ||||||
| sub greet { | sub greet { | ||||||
|  |  | ||||||
| 	my %Param = @_; |     my ( $Self, %Param ) = @_; | ||||||
| 	my $LogObject = Log::Log4perl->get_logger('F1DataBot'); |  | ||||||
| 	use Data::Dumper; |  | ||||||
|  |  | ||||||
| 	$LogObject->info('greet: Initiating greet routine'); |     $Self->{LogObject}->info('greet: Initiating greet routine'); | ||||||
|  |  | ||||||
| 	if ( !defined $Param{Message} ) { |     if ( !defined $Param{Message} ) { | ||||||
| 		$LogObject->error('greet: Message not defined!'); |         $Self->{LogObject}->error('greet: Message not defined!'); | ||||||
| 		return; |         return; | ||||||
| 	} |     } | ||||||
|  |  | ||||||
| 	my @Greetings = qw(Hallo Gruezi Hello Holá Bonjour Konichiwa Shalom Godmorgen); |     my @Greetings = | ||||||
| 	my $Greet = $Greetings[ int(rand(7)) ] || ''; |       qw(Hallo Gruezi Hello Holá Bonjour Konichiwa Shalom Godmorgen); | ||||||
| 	$LogObject->debug('Random Greet is ' . $Greet); |     my $Greet = $Greetings[ int( rand(7) ) ] || ''; | ||||||
| 	my $ReturnContent = $Greet . ', ' . ($Param{Message}->{chat}->{first_name} ? $Param{Message}->{chat}->{first_name} : $Param{Message}->{chat}->{username}) . '!'; |     $Self->{LogObject}->debug( 'Random Greet is ' . $Greet ); | ||||||
| 	$LogObject->debug('ReturnContent is ' . $ReturnContent); |     my $ReturnContent = | ||||||
| 	return $ReturnContent; |       $Greet . ', ' | ||||||
|  |       . ( $Param{Message}->{chat}->{first_name} | ||||||
|  |         ? $Param{Message}->{chat}->{first_name} | ||||||
|  |         : $Param{Message}->{chat}->{username} ) | ||||||
|  |       . '!'; | ||||||
|  |     $Self->{LogObject}->debug( 'ReturnContent is ' . $ReturnContent ); | ||||||
|  |     return { text => $ReturnContent, }; | ||||||
|  |  | ||||||
|  | } | ||||||
|  |  | ||||||
|  | sub build { | ||||||
|  |  | ||||||
|  |     my ( $Self, %Param ) = @_; | ||||||
|  |     use Data::Dumper; | ||||||
|  |     use JSON; | ||||||
|  |     use LWP::Simple::REST qw(POST plain); | ||||||
|  |  | ||||||
|  |     my $EncodedKeyboard = JSON::encode_json( | ||||||
|  |         { | ||||||
|  |             'inline_keyboard' => [ | ||||||
|  |                 [ | ||||||
|  |                     { | ||||||
|  |                         'text'          => 'Grüßen', | ||||||
|  |                         'callback_data' => 'greet' | ||||||
|  |                     }, | ||||||
|  |                     { | ||||||
|  |                         'text'          => 'Statistik', | ||||||
|  |                         'callback_data' => 'statistics' | ||||||
|  |                     }, | ||||||
|  |                 ], | ||||||
|  |             ], | ||||||
|  |             'resize'      => 1, | ||||||
|  |             'single_use'  => 1, | ||||||
|  |             'placeholder' => 'test', | ||||||
|  |         }, | ||||||
|  |     ); | ||||||
|  |     my $ResponseResult = plain POST( | ||||||
|  |         join( '/', ( $TELEGRAM_URL, $TOKEN, 'sendMessage' ) ), | ||||||
|  |         { | ||||||
|  |             'chat_id'             => $Param{Message}->{chat}->{id}, | ||||||
|  |             'reply_to_message_id' => $Param{Message}->{id}, | ||||||
|  |             'text'                => | ||||||
|  | "Hallo $Param{Message}, über die folgenden Fragen kannst du auswählen, welche Interaktion du ausführen möchtest. Was möchtest du tun?", | ||||||
|  |             'reply_markup' => $EncodedKeyboard, | ||||||
|  |         } | ||||||
|  |     ); | ||||||
|  |     $Self->{LogObject}->info( 'build: Sending result is ' . $ResponseResult ); | ||||||
|  |  | ||||||
|  |     return {}; | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| sub statistics { | sub statistics { | ||||||
|  |  | ||||||
| 	my %Param = @_; |     my ( $Self, %Param ) = @_; | ||||||
| 	my $LogObject = Log::Log4perl->get_logger('F1DataBot'); |     use Data::Dumper; | ||||||
| 	use Data::Dumper; |     use LWP::Simple::REST qw(GET json); | ||||||
| 	use LWP::Simple::REST qw(GET json); |  | ||||||
| 	use XML::Parser; |  | ||||||
|  |  | ||||||
| 	$LogObject->info('statistics: Initiating statistics routine'); |     $Self->{LogObject}->info('statistics: Initiating statistics routine'); | ||||||
|  |  | ||||||
| 	if ( !defined $Param{Message} ) { |     if ( !defined $Param{Message} ) { | ||||||
| 		$LogObject->error('statistics: Message not defined!'); |         $Self->{LogObject}->error('statistics: Message not defined!'); | ||||||
| 		return; |         return; | ||||||
| 	} |     } | ||||||
|  |  | ||||||
| 	# Parse arguments |     # Parse arguments | ||||||
| 	# Expected format: driver | constructor | circuit |     # Expected format: driver | constructor | circuit | ||||||
| 	# Circuit: [name] [statistics identifier] [individual parameters] |     # Circuit: [name] [statistics identifier] [individual parameters] | ||||||
| 	$Param{Message}->{text} =~ /^(\/statistics)\s(?<statclass>driver|constructor|circuit)/; |     $Param{Message}->{text} =~ | ||||||
| 	my $StatClass = $+{statclass}; |       /^(\/statistics)\s(?<statclass>driver|constructor|circuit)/; | ||||||
| 	given ( $StatClass ) { |     my $StatClass = $+{statclass}; | ||||||
|  |     my %ReturnData; | ||||||
|  |     given ($StatClass) { | ||||||
|  |  | ||||||
| 		when ( 'driver' ) { |         when ('driver') { | ||||||
| 			$LogObject->info('statistics: Recognizing driver command'); |             $Self->{LogObject}->info('statistics: Recognizing driver command'); | ||||||
| 			$Param{Message}->{text} =~ /^(\/statistics)\s$StatClass\s(?<statidentifier>\w+)/; |             $Param{Message}->{text} =~ | ||||||
| 			my $StatIdentifier = $+{statidentifier}; |               /^(\/statistics)\s$StatClass\s(?<statidentifier>\w+)/; | ||||||
| 			given ( $StatIdentifier ) { |             my $StatIdentifier = $+{statidentifier}; | ||||||
| 				when ( 'standings' ) { |             given ($StatIdentifier) { | ||||||
| 					my $Standings = json POST ( join('/', ($ERGAST_URL, 'current', 'driverStandings.json')), {} ); |                 when ('standings') { | ||||||
| 					$LogObject->info('statistics: Fetched standings are ' . Dumper($Standings)); |                     my $Standings = json POST( | ||||||
| 					my %DriverStandings; |                         join( '/', | ||||||
| 					my $DriverStandingsFormatted = ''; |                             ( $ERGAST_URL, 'current', 'driverStandings.json' ) | ||||||
| 					for my $Driver ( $Standings->{MRData}->{StandingsTable}->{StandingsLists}->[0]->{DriverStandings}->@* ) { |                         ), | ||||||
| 						$DriverStandingsFormatted .= "Position: $Driver->{positionText}, Name: $Driver->{Driver}->{code} - Points: $Driver->{points}\n"; |                         {} | ||||||
| 					} |                     ); | ||||||
| 					return $DriverStandingsFormatted; |                     my %DriverStandings; | ||||||
| 				} |                     my $DriverStandingsFormatted = sprintf( "%-3s%-4s%-5s%7s\n", | ||||||
| 				default { |                         "#", "No.", "Code", "Points" ); | ||||||
| 					return "I'm sorry, " . ($Param{Message}->{chat}->{first_name} ? $Param{Message}->{chat}->{first_name} : $Param{Message}->{chat}->{username}) . ", I recognized you wanted to fetch a statistic about drivers, but I couldn't determine which one. Maybe you want to try again? Currently available are:\n\tstandings"; |                     for my $Driver ( $Standings->{MRData}->{StandingsTable} | ||||||
| 				} |                         ->{StandingsLists}->[0]->{DriverStandings}->@* ) | ||||||
| 			} |                     { | ||||||
| 		} |                         $DriverStandingsFormatted .= sprintf( | ||||||
| 		when ( 'constructor' ) { |                             "%-3d%-4d%-5s%7d\n", | ||||||
| 			$LogObject->info('statistics: Recognizing constructor command'); |                             $Driver->{positionText}, | ||||||
| 		} |                             $Driver->{Driver}->{permanentNumber}, | ||||||
| 		when ( 'circuit' ) { |                             $Driver->{Driver}->{code}, | ||||||
| 			$LogObject->info('statistics: Recognizing circuit command'); |                             $Driver->{points} | ||||||
| 		} |                         ); | ||||||
| 		# Statistics class not recognized |                     } | ||||||
| 		default { |                     $DriverStandingsFormatted =~ s/^/<pre>/; | ||||||
| 			return "I'm sorry, " . ($Param{Message}->{chat}->{first_name} ? $Param{Message}->{chat}->{first_name} : $Param{Message}->{chat}->{username}) . ", I recognized you wanted to fetch a statistic, but I couldn't determine which one. Maybe you want to try again? Currently available are:\n\tdriver\n\tconstructor\n\tcircuit"; |                     $DriverStandingsFormatted =~ s/$/<\/pre>/; | ||||||
| 		} |                     $Self->{LogObject} | ||||||
|  |                       ->info( 'statistics: DriverStandingsFormatted are ' | ||||||
|  |                           . $DriverStandingsFormatted ); | ||||||
|  |                     $Self->{LogObject} | ||||||
|  |                       ->info( 'statistics: DriverStandingsFormattedLength is ' | ||||||
|  |                           . length($DriverStandingsFormatted) ); | ||||||
|  |                     $ReturnData{text}       = $DriverStandingsFormatted; | ||||||
|  |                     $ReturnData{parse_mode} = 'HTML'; | ||||||
|  |                 } | ||||||
|  |                 default { | ||||||
|  |                     $ReturnData{text} = | ||||||
|  |                       "I'm sorry, " | ||||||
|  |                       . ( $Param{Message}->{chat}->{first_name} | ||||||
|  |                         ? $Param{Message}->{chat}->{first_name} | ||||||
|  |                         : $Param{Message}->{chat}->{username} ) | ||||||
|  |                       . ", I recognized you wanted to fetch a statistic about drivers, but I couldn't determine which one. Maybe you want to try again? Currently available are:\n\tstandings"; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         when ('constructor') { | ||||||
|  |             $Self->{LogObject} | ||||||
|  |               ->info('statistics: Recognizing constructor command'); | ||||||
|  |             $Param{Message}->{text} =~ | ||||||
|  |               /^(\/statistics)\s$StatClass\s(?<statidentifier>\w+)/; | ||||||
|  |             my $StatIdentifier = $+{statidentifier}; | ||||||
|  |             given ($StatIdentifier) { | ||||||
|  |                 when ('standings') { | ||||||
|  |                     my $Standings = json POST( | ||||||
|  |                         join( | ||||||
|  |                             '/', | ||||||
|  |                             ( | ||||||
|  |                                 $ERGAST_URL, 'current', | ||||||
|  |                                 'constructorStandings.json' | ||||||
|  |                             ) | ||||||
|  |                         ), | ||||||
|  |                         {} | ||||||
|  |                     ); | ||||||
|  |                     $Self->{LogObject} | ||||||
|  |                       ->info( 'statistics: Fetched standings are ' | ||||||
|  |                           . Dumper($Standings) ); | ||||||
|  |                     my %ConstructorStandings; | ||||||
|  |                     my $ConstructorStandingsFormatted = ''; | ||||||
|  |                     for my $Constructor ( $Standings->{MRData}->{StandingsTable} | ||||||
|  |                         ->{StandingsLists}->[0]->{ConstructorStandings}->@* ) | ||||||
|  |                     { | ||||||
|  |                         $ConstructorStandingsFormatted .= | ||||||
|  | "Position: $Constructor->{positionText}, Name: $Constructor->{Constructor}->{name} - Points: $Constructor->{points}\n"; | ||||||
|  |                     } | ||||||
|  |                     $ConstructorStandingsFormatted =~ s/^/<pre>/; | ||||||
|  |                     $ConstructorStandingsFormatted =~ s/$/<\/pre>/; | ||||||
|  |  | ||||||
| 	} |                     $ReturnData{parse_mode} = 'HTML'; | ||||||
| 	 |                 } | ||||||
| 	# Use system to call the python script (big shame, but nothing to do about it) |                 default { | ||||||
| 	return ''; |                     $ReturnData{text} = | ||||||
|  |                       "I'm sorry, " | ||||||
|  |                       . ( $Param{Message}->{chat}->{first_name} | ||||||
|  |                         ? $Param{Message}->{chat}->{first_name} | ||||||
|  |                         : $Param{Message}->{chat}->{username} ) | ||||||
|  |                       . ", I recognized you wanted to fetch a statistic about constructors, but I couldn't determine which one. Maybe you want to try again? Currently available are:\n\tstandings"; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         when ('circuit') { | ||||||
|  |             $Self->{LogObject}->info('statistics: Recognizing circuit command'); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         # Statistics class not recognized | ||||||
|  |         default { | ||||||
|  |             $ReturnData{text} = | ||||||
|  |               "I'm sorry, " | ||||||
|  |               . ( $Param{Message}->{chat}->{first_name} | ||||||
|  |                 ? $Param{Message}->{chat}->{first_name} | ||||||
|  |                 : $Param{Message}->{chat}->{username} ) | ||||||
|  |               . ", I recognized you wanted to fetch a statistic, but I couldn't determine which one. Maybe you want to try again? Currently available are:\n\tdriver\n\tconstructor\n\tcircuit"; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     return \%ReturnData; | ||||||
|  |  | ||||||
|  |   # Use system to call the python script (big shame, but nothing to do about it) | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| sub processMessage { | sub processMessage { | ||||||
|  |  | ||||||
| 	my %Param     = @_; |     my ( $Self, %Param ) = @_; | ||||||
| 	my $LogObject = Log::Log4perl->get_logger('F1DataBot'); |     use Data::Dumper; | ||||||
| 	use Data::Dumper; |     use LWP::Simple::REST qw(POST plain json); | ||||||
| 	use LWP::Simple::REST qw(POST plain); |  | ||||||
|  |  | ||||||
| 	my %Commands = ( |     my %Commands = ( | ||||||
| 		'greet'      => \&greet, |         'greet'      => \&greet, | ||||||
| 		'statistics' => \&statistics, |         'statistics' => \&statistics, | ||||||
| 	); |         'build'      => \&build, | ||||||
|  |     ); | ||||||
|  |  | ||||||
| 	if ( !defined $Param{Message} ) { |     if ( !defined $Param{Message} ) { | ||||||
| 		$LogObject->error('processMessage: Message not defined!'); |         $Self->{LogObject}->error('processMessage: Message not defined!'); | ||||||
| 		return; |         return; | ||||||
| 	} |     } | ||||||
|  |  | ||||||
| 	$LogObject->info('processMessage: Starting to process message'); |     $Self->{LogObject}->info('processMessage: Starting to process message'); | ||||||
| 	$LogObject->info('processMessage: Message is ' . Dumper($Param{Message})); |     $Self->{LogObject} | ||||||
|  |       ->info( 'processMessage: Message is ' . Dumper( $Param{Message} ) ); | ||||||
|  |  | ||||||
| 	my $Message = $Param{Message}->{message}; |     my $Message = $Param{Message}->{message}; | ||||||
|  |     if ( $Message->{from}->{id} eq '587238001' ) { | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  |  | ||||||
| 	my $ResponseContent; |     my $ResponseData = {}; | ||||||
| 	if ( $Message->{text} =~ /\/(?<command>greet|statistics)\s?(?<arguments>.*)?/ ) { |     if ( $Message->{text} =~ | ||||||
| 		my $Command         = $+{command}; |         /\/(?<command>greet|statistics|build)\s?(?<arguments>.*)?/ ) | ||||||
| 		my $ArgumentsString = $+{arguments}; |     { | ||||||
| 		$ResponseContent    = $Commands{$Command}( |         my $Command         = $+{command}; | ||||||
| 			Message   => $Message, |         my $ArgumentsString = $+{arguments}; | ||||||
| 			Arguments => $ArgumentsString, |         $ResponseData = $Commands{$Command}( | ||||||
| 		);  |             Message   => $Message, | ||||||
| 	} |             Arguments => $ArgumentsString, | ||||||
| 	else { |         ); | ||||||
| 		$LogObject->debug('Command not recognized. Data: ' . $Message->{text}); |         if ( !keys $ResponseData->%* ) { | ||||||
| 		$ResponseContent = "I'm sorry, " . ($Message->{chat}->{first_name} ? $Message->{chat}->{first_name} : $Message->{chat}->{username}) . ", I couldn't understand your request. Currently I can process the commands:\n\n\t\/greet"; |             return; | ||||||
| 	} |         } | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |         $Self->{LogObject} | ||||||
|  |           ->debug( 'Command not recognized. Data: ' . $Message->{text} ); | ||||||
|  |         $ResponseData->{text} = | ||||||
|  |           "I'm sorry, " | ||||||
|  |           . ( $Message->{chat}->{first_name} | ||||||
|  |             ? $Message->{chat}->{first_name} | ||||||
|  |             : $Message->{chat}->{username} ) | ||||||
|  |           . ", I couldn't understand your request. Currently I can process the commands:\n\n\t\/greet\n\t\/statistics driver standings\n\t\/statistics constructor standings"; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  	my $ResponseResult = plain POST ( join('/', ($TELEGRAM_URL, $TOKEN, 'sendMessage')), { |     my $ResponseResult = plain POST( | ||||||
|  				chat_id => $Message->{chat}->{id}, |         join( '/', ( $TELEGRAM_URL, $TOKEN, 'sendMessage' ) ), | ||||||
|  				text    => $ResponseContent, |         { | ||||||
|  			} ); |             chat_id => $Message->{chat}->{id}, | ||||||
|  	$LogObject->info('processMessage: Answering result is ' . Dumper($ResponseResult)); |             $ResponseData->%*, | ||||||
|   |         } | ||||||
|  	# mark message as read |     ); | ||||||
|  	my $SeenResult = plain POST ( join('/', ($TELEGRAM_URL, $TOKEN, 'readMessageContents')), { |     my $Response = JSON::decode_json($ResponseResult); | ||||||
|  			id => $Message->{id}, |     $Self->{LogObject} | ||||||
|  		} ); |       ->info( 'processMessage: Answering result is ' . Dumper($Response) ); | ||||||
|  |  | ||||||
|  |     # mark message as read | ||||||
|  |     my $SeenResult = plain POST( | ||||||
|  |         join( '/', ( $TELEGRAM_URL, $TOKEN, 'readMessageContents' ) ), | ||||||
|  |         { | ||||||
|  |             id => $Message->{id}, | ||||||
|  |         } | ||||||
|  |     ); | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| sub fetchMessages { | sub fetchMessages { | ||||||
|  |  | ||||||
| 	my %Param = @_; |     my ( $Self, %Param ) = @_; | ||||||
| 	my $LogObject = Log::Log4perl->get_logger('F1DataBot'); |     use Data::Dumper; | ||||||
| 	use Data::Dumper; |     use LWP::Simple::REST qw(GET json); | ||||||
| 	use LWP::Simple::REST qw(GET json); |  | ||||||
|  |  | ||||||
| 	my $Method = 'getUpdates'; |     my $Method = 'getUpdates'; | ||||||
| 	$LogObject->info('fetchMessages: Initiating getUpdates'); |     $Self->{LogObject}->info('fetchMessages: Initiating getUpdates'); | ||||||
|  |  | ||||||
| 	my $MessageDataRaw = json GET ( join('/', ($TELEGRAM_URL, $TOKEN, $Method)), {} ); |     my $MessageDataRaw = | ||||||
| 	$LogObject->info('fetchMessages: Messages raw are ' . Dumper($MessageDataRaw)); |       json GET( join( '/', ( $TELEGRAM_URL, $TOKEN, $Method ) ), {} ); | ||||||
| 	my @Messages = $MessageDataRaw->{result}->@*; |     $Self->{LogObject} | ||||||
| 	$LogObject->info('fetchMessages: Messages returned are ' . Dumper(\@Messages)); |       ->info( 'fetchMessages: Messages raw are ' . Dumper($MessageDataRaw) ); | ||||||
| 	for my $Message ( @Messages ) { |     my @Messages = $MessageDataRaw->{result}->@*; | ||||||
| 		$LogObject->info('fetchMessages: Calling processMessage'); |     $Self->{LogObject} | ||||||
| 		processMessage( |       ->info( 'fetchMessages: Messages returned are ' . Dumper( \@Messages ) ); | ||||||
| 			Message => $Message, |     for my $Message (@Messages) { | ||||||
| 		); |         $Self->{LogObject}->info('fetchMessages: Calling processMessage'); | ||||||
| 	} |         processMessage( Message => $Message, ); | ||||||
|  |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -4,4 +4,5 @@ use lib '/home/demiguise/telegram_bot'; | |||||||
|  |  | ||||||
| use F1DataBot; | use F1DataBot; | ||||||
|  |  | ||||||
| F1DataBot::fetchMessages(); | my $F1DataBotObject = F1DataBot->new(); | ||||||
|  | $F1DataBotObject->fetchMessages(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user