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 61e59be26e fixes
2025-02-02 00:11:39 +05:00

16 lines
570 B
C++

#ifndef INTERFACE_CHANNEL_HPP_
#define INTERFACE_CHANNEL_HPP_
#include <pch.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