1

Fix karma, fix private commands, actually add !помощь command

* Fix zero length !karma parsing
* In private chat commands not working except !help
* Miss to add !помощь to parser, so it was noop
This commit is contained in:
eleksir
2020-11-17 01:51:10 +03:00
parent 4bf814c473
commit ac8c0f17de
2 changed files with 39 additions and 21 deletions

View File

@@ -266,11 +266,14 @@ sub command {
} elsif (substr ($text, 1) eq 'lat' || substr ($text, 1) eq 'лат') {
$reply = latAnswer();
} elsif (substr ($text, 1, 6) eq 'karma ' || substr ($text, 1, 6) eq 'карма ' || substr($text, 1) eq 'karma' || substr($text, $1) eq 'карма') {
my $mytext = substr ($text, 7);
my $mytext = '';
if ($mytext ne '') {
if (length($text) >= 7) {
$mytext = substr ($text, 7);
chomp ($mytext);
$mytext = trim ($mytext);
} else {
$mytext = '';
}
$reply = karmaGet ($chatid, $mytext);