From c6dc8755cda4025c7a5cfdbc007faca7b2a0eaa1 Mon Sep 17 00:00:00 2001 From: fxzzy <68549259+fxzzy@users.noreply.github.com> Date: Tue, 21 Jul 2020 04:22:58 +0300 Subject: [PATCH 1/6] Fix typo in user.h Rename publieFlags to publicFlags. --- include/sleepy_discord/user.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sleepy_discord/user.h b/include/sleepy_discord/user.h index 4615b522e..d043be8d2 100644 --- a/include/sleepy_discord/user.h +++ b/include/sleepy_discord/user.h @@ -61,7 +61,7 @@ namespace SleepyDiscord { std::string locale = ""; //the user's chosen language Flags flags = Flags::None; PremiumType premiumType = PremiumType::None; - Flags publieFlags = Flags::None; + Flags publicFlags = Flags::None; JSONStructStart std::make_tuple( @@ -75,7 +75,7 @@ namespace SleepyDiscord { json::pair (&User::locale , "locale" , json::OPTIONAL_FIELD ), json::pair(&User::flags , "flags" , json::OPTIONAL_FIELD ), json::pair(&User::premiumType , "premium_type" , json::OPTIONAL_FIELD ), - json::pair(&User::publieFlags , "public_flags" , json::OPTIONAL_FIELD ), + json::pair(&User::publicFlags , "public_flags" , json::OPTIONAL_FIELD ), json::pair (&User::email , "email" , json::OPTIONAL_FIELD ) ); JSONStructEnd @@ -108,4 +108,4 @@ namespace SleepyDiscord { ); JSONStructEnd }; -} \ No newline at end of file +} From 5841ac1e4d97af358029f07756c20363f8013c68 Mon Sep 17 00:00:00 2001 From: fxzzy <68549259+fxzzy@users.noreply.github.com> Date: Tue, 21 Jul 2020 05:38:41 +0300 Subject: [PATCH 2/6] Update embed.h Make embed flags and constructor with them public. --- include/sleepy_discord/embed.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/sleepy_discord/embed.h b/include/sleepy_discord/embed.h index 5af3a6f58..aa84d634a 100644 --- a/include/sleepy_discord/embed.h +++ b/include/sleepy_discord/embed.h @@ -174,6 +174,12 @@ namespace SleepyDiscord { struct Embed : public DiscordObject { public: + enum class Flag { + INVALID_EMBED = 0, + VALID_EMBED = 1 + }; + Flag flags = Flag::VALID_EMBED; + Embed(const Flag f) : flags(f) {} Embed() = default; //Embed(const std::string * rawJSON); Embed(const json::Value & json); @@ -220,12 +226,5 @@ namespace SleepyDiscord { private: friend BaseDiscordClient; friend SendMessageParams; - - enum class Flag { - INVALID_EMBED = 0, - VALID_EMBED = 1 - }; - Flag flags = Flag::VALID_EMBED; - Embed(const Flag f) : flags(f) {} }; } From 98ef541fef624b95eae0174cf9aca9162f1d67eb Mon Sep 17 00:00:00 2001 From: fxzzy <68549259+fxzzy@users.noreply.github.com> Date: Tue, 21 Jul 2020 14:59:11 +0300 Subject: [PATCH 3/6] Fix typo in permissions.h Replace hasPremission to hasPermission. --- include/sleepy_discord/permissions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sleepy_discord/permissions.h b/include/sleepy_discord/permissions.h index c609281ab..d7aa87f45 100644 --- a/include/sleepy_discord/permissions.h +++ b/include/sleepy_discord/permissions.h @@ -70,7 +70,7 @@ namespace SleepyDiscord { return static_cast(static_cast(a) ^ static_cast(b)); } - inline constexpr bool hasPremission(const Permission& target, const Permission& permission) { + inline constexpr bool hasPermission(const Permission& target, const Permission& permission) { return (target & permission) == permission; } @@ -125,4 +125,4 @@ namespace SleepyDiscord { ); JSONStructEnd }; -} \ No newline at end of file +} From 5f900a3184ca16aca740263547afca952d77587e Mon Sep 17 00:00:00 2001 From: fxzzy <68549259+fxzzy@users.noreply.github.com> Date: Tue, 21 Jul 2020 15:04:40 +0300 Subject: [PATCH 4/6] Update permissions.h For pull request. --- include/sleepy_discord/permissions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sleepy_discord/permissions.h b/include/sleepy_discord/permissions.h index d7aa87f45..2889ca0f8 100644 --- a/include/sleepy_discord/permissions.h +++ b/include/sleepy_discord/permissions.h @@ -69,7 +69,7 @@ namespace SleepyDiscord { inline constexpr Permission operator^(const Permission& a, const Permission& b) { return static_cast(static_cast(a) ^ static_cast(b)); } - + // inline constexpr bool hasPermission(const Permission& target, const Permission& permission) { return (target & permission) == permission; } From 47b524e57db27f72a3323c5d4d8dee5b7a0fd088 Mon Sep 17 00:00:00 2001 From: fxzzy <68549259+fxzzy@users.noreply.github.com> Date: Tue, 21 Jul 2020 15:05:38 +0300 Subject: [PATCH 5/6] Update permissions.h --- include/sleepy_discord/permissions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sleepy_discord/permissions.h b/include/sleepy_discord/permissions.h index 2889ca0f8..e789a373d 100644 --- a/include/sleepy_discord/permissions.h +++ b/include/sleepy_discord/permissions.h @@ -69,8 +69,8 @@ namespace SleepyDiscord { inline constexpr Permission operator^(const Permission& a, const Permission& b) { return static_cast(static_cast(a) ^ static_cast(b)); } - // - inline constexpr bool hasPermission(const Permission& target, const Permission& permission) { + + inline constexpr bool hasPremission(const Permission& target, const Permission& permission) { return (target & permission) == permission; } From d0ce3e270485a09b1b2afb7eb3de633762077d67 Mon Sep 17 00:00:00 2001 From: fxzzy <68549259+fxzzy@users.noreply.github.com> Date: Tue, 21 Jul 2020 15:06:25 +0300 Subject: [PATCH 6/6] Fix typo in permissions.h hasPremission replaced to hasPermission. --- include/sleepy_discord/permissions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sleepy_discord/permissions.h b/include/sleepy_discord/permissions.h index e789a373d..d7aa87f45 100644 --- a/include/sleepy_discord/permissions.h +++ b/include/sleepy_discord/permissions.h @@ -70,7 +70,7 @@ namespace SleepyDiscord { return static_cast(static_cast(a) ^ static_cast(b)); } - inline constexpr bool hasPremission(const Permission& target, const Permission& permission) { + inline constexpr bool hasPermission(const Permission& target, const Permission& permission) { return (target & permission) == permission; }