Toast/TriviaBot/bot/APIHelper.cpp
Jack b31eaef6d6 Bot is now basically functional
Big tidy up, new question source.
2016-07-10 01:18:13 +01:00

19 lines
457 B
C++

#include "http/HTTPHelper.hpp"
#include <cstdio>
#include "APIHelper.hpp"
APIHelper::APIHelper() {
http = new HTTPHelper();
}
void APIHelper::send_message(std::string channel_id, std::string message) {
const std::string url = CHANNELS_URL + "/" + channel_id + "/messages?" + TOKEN_PARAM;
json data = {
{ "content", message }
};
const std::string response = http->post_request(url, JSON_CTYPE, data.dump());
std::cout << response << std::endl;
}