#ifndef API_MESSAGE_HPP_ #define API_MESSAGE_HPP_ #include #include #include #include #include #include #include using std::string; using std::cout; using std::endl; using json = nlohmann::json; class Message { private: json data; WebSocket& web; NetworkManager& req; public: Message(const json& data) : data(data), web(*WebSocket::getInstance()), req(*NetworkManager::getInstance()) {}; string send(const string& id, const json& msg) { return req.request("POST", dapi + "/channels/" + id + "/messages", msg.dump()); } }; #endif