From b6bba21e1018e7c2426ca00b6f49c21004dfe4ee Mon Sep 17 00:00:00 2001 From: Amber Ehrlich Date: Tue, 30 Apr 2024 20:27:25 -0400 Subject: [PATCH] docs: grammar & add nodiscard to some things --- include/dpp/message.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/dpp/message.h b/include/dpp/message.h index eb320fb9bf..d64b481e82 100644 --- a/include/dpp/message.h +++ b/include/dpp/message.h @@ -1615,7 +1615,7 @@ struct DPP_EXPORT poll { * * @return question.text */ - const std::string& get_question_text() const noexcept; + [[nodiscard]] const std::string& get_question_text() const noexcept; /** * @brief Helper to find an answer by ID @@ -1623,16 +1623,16 @@ struct DPP_EXPORT poll { * @param id ID to find * @return Pointer to the answer with the matching ID, or nullptr if not found */ - const poll_media* find_answer(uint32_t id) const noexcept; + [[nodiscard]] const poll_media* find_answer(uint32_t id) const noexcept; /** * @brief Helper to find the vote count in the results * * @param answer_id ID of the answer to find - * @return Optional count of votes. An empty optional mean Discord did not send the results, it does not mean 0. It can also mean the poll does not have an answer with this ID + * @return std::optional Optional count of votes. An empty optional means Discord did not send the results, it does not mean 0. It can also mean the poll does not have an answer with this ID * @see https://discord.com/developers/docs/resources/poll#poll-results-object */ - std::optional get_vote_count(uint32_t answer_id) const noexcept; + [[nodiscard]] std::optional get_vote_count(uint32_t answer_id) const noexcept; }; /** @@ -2565,19 +2565,19 @@ struct DPP_EXPORT message : public managed, json_interface { message& set_poll(const poll& p); /** - * @brief Convenience method to get the poll + * @brief Convenience method to get the poll attached to this message * * @throw std::bad_optional_access if has_poll() == false * @return const poll& Poll attached to this object */ - const poll& get_poll() const; + [[nodiscard]] const poll& get_poll() const; /** * @brief Method to check if the message has a poll * * @return bool Whether the message has a poll */ - bool has_poll() const noexcept; + [[nodiscard]] bool has_poll() const noexcept; }; /**