From f0b1ae9c43b12844b7050df2e11f9c005a323eef Mon Sep 17 00:00:00 2001 From: eleksir Date: Fri, 30 Oct 2020 16:14:28 +0300 Subject: [PATCH] Set default action to "typing" if not supplied in sendChatAction() --- lib/Teapot/Bot/Brain.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Teapot/Bot/Brain.pm b/lib/Teapot/Bot/Brain.pm index be10474..61e1103 100644 --- a/lib/Teapot/Bot/Brain.pm +++ b/lib/Teapot/Bot/Brain.pm @@ -254,6 +254,11 @@ sub sendChatAction { croak "no chat_id supplied in sendChatAction" unless $args->{chat_id}; $send_args->{chat_id} = $args->{chat_id}; + unless (defined $args->{action}) { + $args->{action} = 'typing'; + $send_args->{action} = 'typing'; + } + if ($args->{action} eq 'upload_photo') { $send_args->{action} = 'upload_photo'; }