forked from rcxpony/sparkle
17 lines
570 B
C++
17 lines
570 B
C++
#ifndef API_CHANNEL_HPP_
|
|
#define API_CHANNEL_HPP_
|
|
#include <includes.h>
|
|
#include <net.h>
|
|
using std::string, std::cout, std::endl, nlohmann::json;
|
|
class Channel {
|
|
private:
|
|
json data;
|
|
WebSocket& web;
|
|
NetworkManager& req;
|
|
public:
|
|
Channel(const json& data = "") : data(data), web(WebSocket::getInstance()), req(NetworkManager::getInstance()) {}
|
|
string send(const json& msg) {
|
|
return req.request(HttpMethods::POST, DiscordEndpoints::details::latest + "/channels/" + data["d"]["channel_id"].get<string>() + "/messages", msg.dump());
|
|
}
|
|
};
|
|
#endif |