Update DPP.

This commit is contained in:
Sandu Liviu Catalin committed 2021-09-18 21:19:56 +03:00
1 parent 0f235ff6af
commit b978bc5046
22 files changed
+276 -114

No files matched your search

+37 -3
View File
@@ -30,11 +30,29 @@
namespace dpp {
/**
* @brief dpp::resolved_user contains both a dpp::guild_member and a dpp::user.
* The user can be used to obtain in-depth user details such as if they are nitro,
* and the guild member information to check their roles on a guild etc.
* The Discord API provides both if a parameter is a user ping,
* so we offer both in a combined structure.
*/
struct CoreExport resolved_user {
/**
* @brief Holds user information
*/
dpp::user user;
/**
* @brief Holds member information
*/
dpp::guild_member member;
};
/**
* @brief Represents a received parameter.
* We use variant so that multiple non-related types can be contained within.
*/
typedef std::variant<std::string, dpp::role, dpp::channel, dpp::user, int32_t, bool> command_parameter;
typedef std::variant<std::monostate, std::string, dpp::role, dpp::channel, dpp::resolved_user, int32_t, bool> command_parameter;
/**
* @brief Parameter types when registering a command.
@@ -102,7 +120,7 @@ typedef std::vector<std::pair<std::string, param_info>> parameter_registration_t
/**
* @brief Parameter list for a called command.
* See dpp::parameter_registration_t for an explaination as to why vector is used.
* See dpp::parameter_registration_t for an explanation as to why vector is used.
*/
typedef std::vector<std::pair<std::string, command_parameter>> parameter_list_t;
@@ -277,9 +295,25 @@ public:
* to the user if you do not emit some form of reply within 3 seconds.
*
* @param m message to reply with.
* @param interaction true if the reply is generated by an interaction
* @param source source of the command
*/
void reply(const dpp::message &m, command_source source);
/**
* @brief Reply to a command without a message, causing the discord client
* to display "Bot name is thinking...".
* The "thinking" message will persist for a maximum of 15 minutes.
* This counts as a reply for a slash command. Slash commands will emit an
* ugly error to the user if you do not emit some form of reply within 3
* seconds.
*
* @param source source of the command
*/
void thinking(command_source source);
/* Easter egg */
void thonk(command_source source);
};
};