From 08336037ddb06866f39c0e3c98e7b28c9ded6fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hauke=20Z=C3=BChl?= Date: Sun, 4 Jun 2017 12:43:01 +0200 Subject: [PATCH] Added overloaded method for sending a photo --- include/Telegram/TelegramBot.h | 1 + src/TelegramBot.cc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/Telegram/TelegramBot.h b/include/Telegram/TelegramBot.h index 7be313e..8e48f73 100644 --- a/include/Telegram/TelegramBot.h +++ b/include/Telegram/TelegramBot.h @@ -41,6 +41,7 @@ namespace Telegram { void sendMessage(std::string, Json::Int64); void sendMessage(std::string, std::string); + void sendPhoto(std::string, Json::Int64); void sendPhoto(std::string, std::string); Telegram::Message *getMessage(); diff --git a/src/TelegramBot.cc b/src/TelegramBot.cc index 83bda12..73961ff 100644 --- a/src/TelegramBot.cc +++ b/src/TelegramBot.cc @@ -104,6 +104,14 @@ void Telegram::TelegramBot::sendMessage(std::string message, std::string chat_id this->apiRequestJson("sendMessage", params); } +/** + * Sends a picture from the internet to a chat + */ +void Telegram::TelegramBot::sendPhoto(std::string URL, Json::Int64 chat_id) { + + this->sendPhoto(URL, SSTR(chat_id)); +} + /** * Sends a picture from the internet to a chat */