#ifndef API_USER_HPP_
#define API_USER_HPP_
#include <utils/types.hpp>
#include <string>
#include <exception>
#include <iostream>
#include <tls/network.hpp>
#include <gateway/websocket.hpp>
using std::string;
using std::cout;
using std::endl;
class User {
private:
    json data;
    WebSocket& web;
    NetworkManager& req;
public:
    User(const json& data) : data(data), web(*WebSocket::getInstance()), req(*NetworkManager::getInstance()) {}
    string id() {
        return data["d"]["author"]["id"];
    }
    string me() const {
        return req.request("GET", dapi + "/users/@me", "");
    }
    bool isBot() {
        try {
            return data["d"]["author"]["bot"];
        }
        catch (...) {
            return false;
        }
    }
};
#endif