From a51a54bc5979a2491f152abc47ad54e6b63f27c8 Mon Sep 17 00:00:00 2001 From: Dylam De La Torre Date: Tue, 23 Nov 2021 05:21:56 +0100 Subject: Restructure source and resource files (#46) importantly, res is now res/res and css is now res/css --- src/discord/member.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/discord/member.hpp (limited to 'src/discord/member.hpp') diff --git a/src/discord/member.hpp b/src/discord/member.hpp new file mode 100644 index 0000000..e17da05 --- /dev/null +++ b/src/discord/member.hpp @@ -0,0 +1,27 @@ +#pragma once +#include "snowflake.hpp" +#include "json.hpp" +#include "user.hpp" +#include "role.hpp" +#include +#include + +struct GuildMember { + std::optional User; // only reliable to access id. only opt in MESSAGE_* + std::string Nickname; + std::vector Roles; + std::string JoinedAt; + std::optional PremiumSince; // null + bool IsDeafened; + bool IsMuted; + std::optional UserID; // present in merged_members + std::optional IsPending; // this uses `pending` not `is_pending` + + // undocuemtned moment !!!1 + std::optional Avatar; + + std::vector GetSortedRoles() const; + + void update_from_json(const nlohmann::json &j); + friend void from_json(const nlohmann::json &j, GuildMember &m); +}; -- cgit v1.2.3