Skip to content

Commit 75d138a

Browse files
committed
docs: Update webhook struct docs to indicate exclusivity
1 parent c94e3ab commit 75d138a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/dpp/webhook.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,15 @@ class DPP_EXPORT webhook : public managed, public json_interface<webhook> {
114114
/**
115115
* @brief The default avatar of the webhook.
116116
*
117+
* @note This value will not have any effect when `avatar_url` is set, they are mutually exclusive.
117118
* @note This may be empty.
118119
*/
119120
utility::iconhash avatar;
120121

121122
/**
122123
* @brief Avatar URL to use instead of the default if it is set.
123124
*
125+
* @note This will override `avatar` if it is set, they are mutually exclusive.
124126
* @note This may be empty.
125127
*/
126128
std::string avatar_url;

src/dpp/cluster/webhook.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void cluster::execute_webhook(const class webhook &wh, const struct message& m,
7373
{"with_components", true},
7474
});
7575
std::string body;
76-
if (!thread_name.empty() || !wh.avatar.to_string().empty() || !wh.avatar_url.empty() || !wh.name.empty()) { // only use json::parse if thread_name is set
76+
if (!thread_name.empty() || !wh.avatar.to_string().empty() || !wh.avatar_url.empty() || !wh.name.empty()) { // only use json::parse if a value needs to be changed
7777
json j = m.to_json(false);
7878
if (!thread_name.empty()) {
7979
j["thread_name"] = thread_name;

0 commit comments

Comments
 (0)