diff options
author | Guillermo Ramos | 2020-04-26 11:49:06 +0200 |
---|---|---|
committer | Guillermo Ramos | 2020-04-26 11:49:10 +0200 |
commit | c5191f10359f32a3af44f4087322348602734a3c (patch) | |
tree | 2d1de0e76b522157323a23c049689a55c48a18df /tgserver | |
parent | 6f347a1ff480a16a4010ef5b5a044bc55ff2c6f7 (diff) | |
download | tgutils-c5191f10359f32a3af44f4087322348602734a3c.tar.gz |
Support photos in tgserver
Diffstat (limited to 'tgserver')
-rwxr-xr-x | tgserver | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -114,7 +114,13 @@ sub reply { if ($type eq 'DOCUMENT') { my $caption = $response->{'caption'}; $logger->info("🤖: [Document '$caption'] -> $chat_id\n"); - $api->send_document($chat_id, decode_base64 $response->{'content'}, $caption); + $api->send_document($chat_id, decode_base64 $response->{'content'}, + $response->{'filename'}, $caption); + } elsif ($type eq 'PHOTO') { + my $caption = $response->{'caption'}; + $logger->info("🤖: [Photo '$caption'] -> $chat_id\n"); + $api->send_photo($chat_id, decode_base64 $response->{'content'}, + $response->{'filename'}, $caption); } elsif ($type eq 'TEXT' and $response) { $logger->info("🤖: '$response' -> $chat_id\n"); $api->send_message($chat_id, $response); |