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

feat: added dpp::g_developer_support_server guild flag #533

Merged
merged 13 commits into from
Oct 29, 2022
Merged
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
8 changes: 8 additions & 0 deletions include/dpp/guild.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ enum guild_flags_extra : uint8_t {
g_auto_moderation = 0b00000100,
/** Guild has paused invites, preventing new users from joining */
g_invites_disabled = 0b00001000,
/** Guild has been set as support server of an app in the App Directory */
g_developer_support_server = 0b00010000,
};

/**
Expand Down Expand Up @@ -798,6 +800,12 @@ class DPP_EXPORT guild : public managed, public json_interface<guild> {
*/
bool has_auto_moderation() const;

/**
* @brief Guild has been set as a support server on the App Directory
* @return bool has been set as a support server of an app in the app directory
*/
bool has_support_server() const;

/**
* @brief Guild has access to set an animated guild icon
* @return bool can have animated icon
Expand Down
5 changes: 5 additions & 0 deletions src/dpp/guild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const std::map<std::string, std::variant<dpp::guild_flags, dpp::guild_flags_extr
{"VERIFIED", dpp::g_verified },
{"PARTNERED", dpp::g_partnered },
{"COMMUNITY", dpp::g_community },
{"DEVELOPER_SUPPORT_SERVER", dpp::g_developer_support_server },
{"COMMERCE", dpp::g_commerce },
{"NEWS", dpp::g_news },
{"DISCOVERABLE", dpp::g_discoverable },
Expand Down Expand Up @@ -306,6 +307,10 @@ bool guild::has_auto_moderation() const {
return this->flags_extra & g_auto_moderation;
}

bool guild::has_support_server() const {
return this->flags_extra & g_developer_support_server;
}

bool guild::has_animated_icon() const {
return this->flags & g_animated_icon;
}
Expand Down