2019-05-08 19:19:42 +02:00
|
|
|
//
|
|
|
|
// Created by lukas on 08.05.19.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "TelegramAPI.h"
|
|
|
|
|
|
|
|
void TelegramAPI::sendMessage(std::string text) {
|
2019-05-10 08:30:08 +02:00
|
|
|
Hashmap<std::string, std::string> args;
|
|
|
|
args.add("chat_id", chatid);
|
|
|
|
args.add("text", text);
|
|
|
|
|
|
|
|
std::vector<std::string> headers;
|
|
|
|
|
|
|
|
std::string reply = request("https://api.telegram.org/bot" + apikey + "/sendmessage", false, args, headers);
|
2019-05-08 19:31:49 +02:00
|
|
|
std::cout << "[DEBUG] " << reply << std::endl;
|
2019-05-08 19:19:42 +02:00
|
|
|
}
|