From 83417819186394e8d840167841103211ebe5fe33 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Thu, 24 Sep 2020 02:15:25 -0400 Subject: basic permission handling + use for edit/delete --- discord/channel.hpp | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'discord/channel.hpp') diff --git a/discord/channel.hpp b/discord/channel.hpp index 78246f6..9d876e3 100644 --- a/discord/channel.hpp +++ b/discord/channel.hpp @@ -2,6 +2,8 @@ #include "snowflake.hpp" #include "json.hpp" #include "user.hpp" +#include "permissions.hpp" +#include #include #include @@ -16,24 +18,26 @@ enum class ChannelType : int { }; struct Channel { - Snowflake ID; // - ChannelType Type; // - Snowflake GuildID; // opt - int Position = -1; // opt - // std::vector PermissionOverwrites; // opt - std::string Name; // opt, null (null for dm's) - std::string Topic; // opt, null - bool IsNSFW = false; // opt - Snowflake LastMessageID; // opt, null - int Bitrate = 0; // opt - int UserLimit = 0; // opt - int RateLimitPerUser = 0; // opt - std::vector Recipients; // opt - std::string Icon; // opt, null - Snowflake OwnerID; // opt - Snowflake ApplicationID; // opt - Snowflake ParentID; // opt, null - std::string LastPinTimestamp; // opt, can be null even tho docs say otherwise + Snowflake ID; // + ChannelType Type; // + Snowflake GuildID; // opt + int Position = -1; // opt + std::vector PermissionOverwrites; // opt + std::string Name; // opt, null (null for dm's) + std::string Topic; // opt, null + bool IsNSFW = false; // opt + Snowflake LastMessageID; // opt, null + int Bitrate = 0; // opt + int UserLimit = 0; // opt + int RateLimitPerUser = 0; // opt + std::vector Recipients; // opt + std::string Icon; // opt, null + Snowflake OwnerID; // opt + Snowflake ApplicationID; // opt + Snowflake ParentID; // opt, null + std::string LastPinTimestamp; // opt, can be null even tho docs say otherwise friend void from_json(const nlohmann::json &j, Channel &m); + + std::optional GetOverwrite(Snowflake id) const; }; -- cgit v1.2.3