From 36f2ec0996d937400e2fce028c3da729ad951f31 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Mon, 28 Aug 2023 21:47:04 -0400 Subject: fix webhook messages not using right username + avatar (fixes #209) --- src/discord/webhook.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/discord/webhook.cpp') diff --git a/src/discord/webhook.cpp b/src/discord/webhook.cpp index 4e8b422..318f8c8 100644 --- a/src/discord/webhook.cpp +++ b/src/discord/webhook.cpp @@ -11,3 +11,7 @@ void from_json(const nlohmann::json &j, WebhookData &m) { JS_O("token", m.Token); JS_N("application_id", m.ApplicationID); } + +std::string WebhookMessageData::GetAvatarURL() const { + return Avatar.empty() ? "" : "https://cdn.discordapp.com/avatars/" + std::to_string(WebhookID) + "/" + Avatar + ".png?size=32"; +} -- cgit v1.2.3