Browse Source

Added overloaded method for sending a photo

develop
Hauke Zühl 7 years ago
parent
commit
08336037dd
  1. 1
      include/Telegram/TelegramBot.h
  2. 8
      src/TelegramBot.cc

1
include/Telegram/TelegramBot.h

@ -41,6 +41,7 @@ namespace Telegram {
void sendMessage(std::string, Json::Int64); void sendMessage(std::string, Json::Int64);
void sendMessage(std::string, std::string); void sendMessage(std::string, std::string);
void sendPhoto(std::string, Json::Int64);
void sendPhoto(std::string, std::string); void sendPhoto(std::string, std::string);
Telegram::Message *getMessage(); Telegram::Message *getMessage();

8
src/TelegramBot.cc

@ -104,6 +104,14 @@ void Telegram::TelegramBot::sendMessage(std::string message, std::string chat_id
this->apiRequestJson("sendMessage", params); 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 * Sends a picture from the internet to a chat
*/ */

Loading…
Cancel
Save