Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in permissions.h #178

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions include/sleepy_discord/embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {}
};
}
4 changes: 2 additions & 2 deletions include/sleepy_discord/permissions.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace SleepyDiscord {
return static_cast<Permission>(static_cast<int64_t>(a) ^ static_cast<int64_t>(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;
}

Expand Down Expand Up @@ -125,4 +125,4 @@ namespace SleepyDiscord {
);
JSONStructEnd
};
}
}
6 changes: 3 additions & 3 deletions include/sleepy_discord/user.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -75,7 +75,7 @@ namespace SleepyDiscord {
json::pair (&User::locale , "locale" , json::OPTIONAL_FIELD ),
json::pair<json::EnumTypeHelper>(&User::flags , "flags" , json::OPTIONAL_FIELD ),
json::pair<json::EnumTypeHelper>(&User::premiumType , "premium_type" , json::OPTIONAL_FIELD ),
json::pair<json::EnumTypeHelper>(&User::publieFlags , "public_flags" , json::OPTIONAL_FIELD ),
json::pair<json::EnumTypeHelper>(&User::publicFlags , "public_flags" , json::OPTIONAL_FIELD ),
json::pair (&User::email , "email" , json::OPTIONAL_FIELD )
);
JSONStructEnd
Expand Down Expand Up @@ -108,4 +108,4 @@ namespace SleepyDiscord {
);
JSONStructEnd
};
}
}