summaryrefslogtreecommitdiff
path: root/discord/webhook.hpp
blob: f0214df309bf7e59708437d162214db8a67a46dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include <optional>
#include "json.hpp"
#include "snowflake.hpp"
#include "user.hpp"

enum class WebhookType {
    Incoming = 1,
    ChannelFollower = 2,
};

struct WebhookData {
    Snowflake ID;
    WebhookType Type;
    std::optional<Snowflake> GuildID;
    Snowflake ChannelID;
    std::optional<UserData> User;
    std::string Name;   // null
    std::string Avatar; // null
    std::optional<std::string> Token;
    Snowflake ApplicationID; // null

    friend void from_json(const nlohmann::json &j, WebhookData &m);
};