1

Compare commits

...

2 Commits

Author SHA1 Message Date
eleksir
c9b46cc6f0 Use sendChatAction() correctly 2020-10-28 16:25:54 +03:00
eleksir
0397b3c9cf Rename .perlcriticrc file 2020-10-28 15:20:38 +03:00
2 changed files with 5 additions and 2 deletions

View File

@@ -162,10 +162,10 @@ sub __on_msg {
} }
# let's emulate real human and delay answer # let's emulate real human and delay answer
sleep (int ( rand (3) + 1)); sleep (int ( rand (2) + 1));
for (0..(4 + int (rand (3)))) { for (0..(4 + int (rand (3)))) {
sendChatAction($chatid); sendChatAction ($self, $chatid);
sleep(3); sleep(3);
sleep 3 unless ($_); sleep 3 unless ($_);
} }
@@ -242,6 +242,8 @@ sub __on_msg {
} }
} }
sendChatAction ($self, $chatid);
sleep 1;
logger sprintf ("Private chat bot reply to $vis_a_vi: %s", $reply); logger sprintf ("Private chat bot reply to $vis_a_vi: %s", $reply);
$msg->reply ($reply); $msg->reply ($reply);
# group chat # group chat
@@ -383,6 +385,7 @@ MYHELP
$reply = randomCommonPhrase(); $reply = randomCommonPhrase();
} }
sendChatAction ($self, $chatid);
sleep (int (rand (2))); sleep (int (rand (2)));
logger sprintf ('In public chat %s (%s) bot reply to %s: %s', $chatname, $chatid, $vis_a_vi, $reply); logger sprintf ('In public chat %s (%s) bot reply to %s: %s', $chatname, $chatid, $vis_a_vi, $reply);
$msg->reply ($reply); $msg->reply ($reply);