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) {} }; } 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 +} 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 +} diff --git a/sleepy_discord/permissions.cpp b/sleepy_discord/permissions.cpp index 3689d3495..ad6749566 100644 --- a/sleepy_discord/permissions.cpp +++ b/sleepy_discord/permissions.cpp @@ -20,7 +20,7 @@ namespace SleepyDiscord { permissions = permissions | rolePermissions->permissions; } - if (hasPremission(permissions, Permission::ADMINISTRATOR)) + if (hasPermission(permissions, Permission::ADMINISTRATOR)) return Permission::ALL; return permissions; } @@ -34,7 +34,7 @@ namespace SleepyDiscord { } Permission overwritePermissions(const Permission basePermissions, const Server& server, const ServerMember& member, const Channel& channel) { - if (hasPremission(basePermissions, Permission::ADMINISTRATOR)) + if (hasPermission(basePermissions, Permission::ADMINISTRATOR)) return Permission::ALL; Permission permissions = basePermissions; @@ -75,4 +75,4 @@ namespace SleepyDiscord { Role::Role(const nonstd::string_view & json) : Role(json::fromJSON(json)) { } -} \ No newline at end of file +}