Added sendPhoto
This commit is contained in:
parent
a2f1efdb47
commit
d6db3e71b7
@ -41,6 +41,8 @@ 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, std::string);
|
||||||
|
|
||||||
Telegram::Message *getMessage();
|
Telegram::Message *getMessage();
|
||||||
std::map<std::string, TCommand> getCommandMap();
|
std::map<std::string, TCommand> getCommandMap();
|
||||||
|
|
||||||
|
@ -92,6 +92,9 @@ void Telegram::TelegramBot::sendMessage(std::string message, Json::Int64 chat_id
|
|||||||
this->sendMessage(message, SSTR(chat_id));
|
this->sendMessage(message, SSTR(chat_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sendMessage sends a simple text message to a given chat (might be a user or a group)
|
||||||
|
*/
|
||||||
void Telegram::TelegramBot::sendMessage(std::string message, std::string chat_id) {
|
void Telegram::TelegramBot::sendMessage(std::string message, std::string chat_id) {
|
||||||
|
|
||||||
std::map<std::string, std::string> params;
|
std::map<std::string, std::string> params;
|
||||||
@ -101,6 +104,19 @@ void Telegram::TelegramBot::sendMessage(std::string message, std::string chat_id
|
|||||||
this->apiRequestJson("sendMessage", params);
|
this->apiRequestJson("sendMessage", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a phot from the internet to a chat
|
||||||
|
*/
|
||||||
|
void Telegram::TelegramBot::sendPhoto(std::string URL, std::string chat_id) {
|
||||||
|
|
||||||
|
std::map<std::string, std::string> params;
|
||||||
|
|
||||||
|
params["chat_id"] = chat_id;
|
||||||
|
params["photo"] = URL;
|
||||||
|
|
||||||
|
this->apiRequestJson("sendPhoto", params);
|
||||||
|
}
|
||||||
|
|
||||||
Telegram::Message *Telegram::TelegramBot::getMessage() {
|
Telegram::Message *Telegram::TelegramBot::getMessage() {
|
||||||
|
|
||||||
return(this->msg);
|
return(this->msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user