From 9a86ebb5bdf5deb7fd75ba3c43a5cffa25849180 Mon Sep 17 00:00:00 2001 From: eleksir Date: Sun, 6 Sep 2020 14:59:03 +0300 Subject: [PATCH] Actually check 2 letters on 1 letter command invocation. --- lib/telegrambot.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/telegrambot.pm b/lib/telegrambot.pm index e0dc5c7..d6f6d20 100644 --- a/lib/telegrambot.pm +++ b/lib/telegrambot.pm @@ -87,8 +87,8 @@ sub __on_msg { $reply = "Pong."; } elsif (substr($text, 1) eq "пинг") { $reply = "Понг."; - } elsif (substr($text, 1, 1) eq 'w' || substr($text, 1, 1) eq 'п') { - my $city = substr($text, 2); + } elsif (substr($text, 1, 2) eq 'w ' || substr($text, 1, 2) eq 'п ') { + my $city = substr($text, 3); $reply = weather($city); } } elsif (