This repository has been archived on 2025-03-15. You can view files and clone it, but cannot push or open issues or pull requests.
sparkle/libs/interface/Channel.hpp
fluttershy 2e54a17b5d fixes
2025-01-29 16:06:47 +05:00

16 lines
575 B
C++

#ifndef INTERFACE_CHANNEL_HPP_
#define INTERFACE_CHANNEL_HPP_
#include <includes.hpp>
#include <network.hpp>
class Channel {
private:
const nlohmann::json& data;
WebSocket& web;
NetworkManager& req;
public:
Channel(const nlohmann::json& data) : data(data), web(WebSocket::getInstance()), req(NetworkManager::getInstance()) {}
std::string send(const nlohmann::json& msg) {
return req.request(HttpMethods::POST, DiscordEndpoints::details::latest + "/channels/" + data["d"]["channel_id"].get<std::string>() + "/messages", msg.dump());
}
};
#endif