diff --git a/src/api/util.h b/src/api/util.h index 912efb8..7c47742 100644 --- a/src/api/util.h +++ b/src/api/util.h @@ -3,6 +3,7 @@ #include #include +#include class util { public: @@ -24,12 +25,43 @@ public: */ static dpp::embed getDefaultEmbed(EmbedType type = INFO); + /** + * @brief Sends a success message + * @param event The event + * @param message The message + */ + static void sendSuccess(const dpp::slashcommand_t& event, const std::string& message); + + /** + * @brief Sends an error message + * @param event The event + * @param message The message + */ + static void sendError(const dpp::slashcommand_t& event, const std::string& message); + /** * @brief Creates a connection to the database * @param config The database config * @return The connection */ static sql::Connection* createConnection(const json& config); + + /** + * @brief Gets a result set from a query + * @param con The connection + * @param query The query + * @param params The parameters + * @return The result set + */ + static sql::ResultSet* getResultSet(sql::Connection& con, const std::string& query, std::initializer_list params); + + /** + * @brief Executes a query + * @param con The connection + * @param query The query + * @param params The parameters + */ + static void executeQuery(sql::Connection& con, const std::string& query, std::initializer_list params); };