diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-07-27 22:54:17 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-07-27 22:54:17 -0400 |
commit | 9d2d13a3898f05f9e8189f99087198726d476e1b (patch) | |
tree | a5e159e426f30920b136ba5137d76366dffe516b /discord/channel.hpp | |
parent | 1936f9ab8ab8687e3200a0ea31937339f9264c9e (diff) | |
download | abaddon-portaudio-9d2d13a3898f05f9e8189f99087198726d476e1b.tar.gz abaddon-portaudio-9d2d13a3898f05f9e8189f99087198726d476e1b.zip |
very rudimentary thread support
Diffstat (limited to 'discord/channel.hpp')
-rw-r--r-- | discord/channel.hpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/discord/channel.hpp b/discord/channel.hpp index 68597e6..d262ddf 100644 --- a/discord/channel.hpp +++ b/discord/channel.hpp @@ -15,9 +15,10 @@ enum class ChannelType : int { GUILD_NEWS = 5, GUILD_STORE = 6, /* 7 and 8 were used for LFG */ - /* 9 and 10 were used for threads */ - PUBLIC_THREAD = 11, - PRIVATE_THREAD = 12, + /* 9 was used for threads */ + GUILD_NEWS_THREAD = 10, + GUILD_PUBLIC_THREAD = 11, + GUILD_PRIVATE_THREAD = 12, GUILD_STAGE_VOICE = 13, }; @@ -37,6 +38,15 @@ constexpr const char *GetStagePrivacyDisplayString(StagePrivacy e) { } } +struct ThreadMetadata { + bool IsArchived; + int AutoArchiveDuration; + std::string ArchiveTimestamp; + std::optional<bool> IsLocked; + + friend void from_json(const nlohmann::json &j, ThreadMetadata &m); +}; + struct ChannelData { Snowflake ID; ChannelType Type; @@ -57,6 +67,7 @@ struct ChannelData { std::optional<Snowflake> ApplicationID; std::optional<Snowflake> ParentID; // null std::optional<std::string> LastPinTimestamp; // null + std::optional<ThreadMetadata> ThreadMetadata; friend void from_json(const nlohmann::json &j, ChannelData &m); void update_from_json(const nlohmann::json &j); |