diff --git a/README.md b/README.md index 98b1578..5545024 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ ### 📚 Libraries and version These are libraries that we're using in this project: -- [Dpp](https://github.com/brainboxdotcc/DPP) - version `10.0.21` (latest) +- [Dpp](https://github.com/brainboxdotcc/DPP) - version `10.0.22` (BETA) - [Spdlog](https://github.com/gabime/spdlog) - version `1.11.0` (latest) - [Base64](https://gist.github.com/tomykaira/f0fd86b6c73063283afe550bc5d77594) diff --git a/include/dpp/appcommand.h b/include/dpp/appcommand.h index 804aa15..368caaa 100644 --- a/include/dpp/appcommand.h +++ b/include/dpp/appcommand.h @@ -294,8 +294,6 @@ enum interaction_response_type { ir_update_message = 7, //!< for components, edit the message the component was attached to ir_autocomplete_reply = 8, //!< Reply to autocomplete interaction. Be sure to do this within 500ms of the interaction! ir_modal_dialog = 9, //!< A modal dialog box - - ir_default = 0, /// From Harshfeudal's shorten }; /** diff --git a/include/dpp/automod.h b/include/dpp/automod.h index aade982..cceaca6 100644 --- a/include/dpp/automod.h +++ b/include/dpp/automod.h @@ -107,9 +107,10 @@ enum automod_trigger_type : uint8_t { */ struct DPP_EXPORT automod_metadata : public json_interface { /** - * @brief @brief Substrings which will be searched for in content. + * @brief @brief Substrings which will be searched for in content (Maximum of 1000). * - * Each keyword can be a phrase which contains multiple words. All keywords are case insensitive. + * Each keyword can be a phrase which contains multiple words. + * All keywords are case insensitive and can be up to 30 characters. * * Wildcard symbols (`*`) can be used to customize how each keyword will be matched. * @@ -146,6 +147,14 @@ struct DPP_EXPORT automod_metadata : public json_interface { */ std::vector keywords; + /** + * @brief Regular expression patterns which will be matched against content (Maximum of 10). + * + * Only Rust flavored regex is currently supported, which can be tested in online editors such as [Rustexp](https://rustexp.lpil.uk/). + * Each regex pattern must be 75 characters or less. + */ + std::vector regex_patterns; + /** * @brief Preset keyword list types to moderate * @see automod_preset_type diff --git a/include/dpp/dpp.h b/include/dpp/dpp.h index f70b303..3e3d0b5 100644 --- a/include/dpp/dpp.h +++ b/include/dpp/dpp.h @@ -72,5 +72,3 @@ #include #include #include - -#include diff --git a/include/dpp/message.h b/include/dpp/message.h index ffef918..fb65d88 100644 --- a/include/dpp/message.h +++ b/include/dpp/message.h @@ -979,10 +979,6 @@ enum message_flags : uint16_t { m_loading = 1 << 7, /// this message failed to mention some roles and add their members to the thread m_thread_mention_failed = 1 << 8, - - /// this null enum was added by @harshfeudal, to use `#include ` for shorten code - /// this message is just a normal message, no ephemeral, no any cosmetic - m_default = 0, }; /** diff --git a/include/dpp/user.h b/include/dpp/user.h index 36c10ba..aa16282 100644 --- a/include/dpp/user.h +++ b/include/dpp/user.h @@ -76,6 +76,8 @@ enum user_flags : uint32_t { u_bot_http_interactions = 0b00100000000000000000000, /// User has nitro basic u_nitro_basic = 0b01000000000000000000000, + /// User has the active developer badge + u_active_developer = 0b10000000000000000000000, }; /** @@ -136,6 +138,12 @@ class DPP_EXPORT user : public managed, public json_interface { */ std::string get_mention() const; + /** + * @brief Return true if user has the active Developer badge + * + * @return true if has active developer + */ + bool is_active_developer() const; /** * @brief User is a bot * diff --git a/include/dpp/version.h b/include/dpp/version.h index 5ffdcb3..bb8d693 100644 --- a/include/dpp/version.h +++ b/include/dpp/version.h @@ -21,9 +21,9 @@ #pragma once #if !defined(DPP_VERSION_LONG) -#define DPP_VERSION_LONG 0x00100021 -#define DPP_VERSION_SHORT 100021 -#define DPP_VERSION_TEXT "D++ 10.0.21 (02-Oct-2022)" +#define DPP_VERSION_LONG 0x00100022 +#define DPP_VERSION_SHORT 100022 +#define DPP_VERSION_TEXT "D++ 10.0.22 (01-Nov-2022)" #define DPP_VERSION_MAJOR ((DPP_VERSION_LONG & 0x00ff0000) >> 16) #define DPP_VERSION_MINOR ((DPP_VERSION_LONG & 0x0000ff00) >> 8) diff --git a/lib/dpp.lib b/lib/dpp.lib index 7d7d62b..99fd0f6 100644 Binary files a/lib/dpp.lib and b/lib/dpp.lib differ diff --git a/src/information/userInfo.cpp b/src/information/userInfo.cpp index 696f016..f31a6ec 100644 --- a/src/information/userInfo.cpp +++ b/src/information/userInfo.cpp @@ -67,10 +67,8 @@ void userInfo(dpp::cluster& client, const dpp::slashcommand_t& event) if (std::holds_alternative(event.get_parameter("user")) == true) usrId = std::get(event.get_parameter("user")); - dpp::user_identified tgtId = client.user_get_sync(usrId); - // If cannot find the user - if (!dpp::find_user(usrId)) + if (dpp::find_user(usrId) == false) { EmbedBuild(embed, 0xFF7578, errorTitle, warnTitle, "User not found!", event.command.usr); event.reply( @@ -80,6 +78,8 @@ void userInfo(dpp::cluster& client, const dpp::slashcommand_t& event) return; } + dpp::user_identified tgtId = client.user_get_sync(usrId); + // This is under-investigation [Library bug] if (tgtId.is_discord_employee()) hasStaffBadge = StaffBadge; @@ -115,6 +115,22 @@ void userInfo(dpp::cluster& client, const dpp::slashcommand_t& event) if (tgtId.has_nitro_basic() || tgtId.has_nitro_classic() || tgtId.has_nitro_full()) hasNitroBadge = NitroSubscriber; + std::cout << "member object: " << std::endl; + std::cout << "id " << tgtId.id << std::endl; + std::cout << "username " << tgtId.username << std::endl; + std::cout << "flags " << tgtId.flags << std::endl; + std::cout << "bravery " << tgtId.is_house_bravery() << std::endl; + std::cout << "brilliance " << tgtId.is_house_brilliance() << std::endl; + std::cout << "balance " << tgtId.is_house_balance() << std::endl; + std::cout << "is_bot " << tgtId.is_bot() << std::endl; + std::cout << "is_active_developer " << tgtId.is_active_developer() << std::endl; + std::cout << "has_nitro_basic " << tgtId.has_nitro_basic() << std::endl; + std::cout << "has_nitro_classic " << tgtId.has_nitro_classic() << std::endl; + std::cout << "has_nitro_full " << tgtId.has_nitro_full() << std::endl; + std::cout << "is_verified_bot_dev " << tgtId.is_verified_bot_dev() << std::endl; + std::cout << "is_bughunter_1 " << tgtId.is_bughunter_1() << std::endl; + std::cout << "is_bughunter_2 " << tgtId.is_bughunter_2() << std::endl; + const auto avatar = tgtId.get_avatar_url(); const auto usrID = fmt::format("{}", tgtId.id); const auto created = fmt::format("", round(tgtId.get_creation_time())); diff --git a/src/main.cpp b/src/main.cpp index 1c7b723..0b43ae5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include