From b2d53a69c4f0f01711e74f537eeaef83e13e971d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 10 Dec 2022 21:27:13 -0500 Subject: Looks like the nickname field is only set if you actually have a nickname --- lingo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lingo.cpp') diff --git a/lingo.cpp b/lingo.cpp index 3dc8b8f..1cb13ce 100644 --- a/lingo.cpp +++ b/lingo.cpp @@ -367,10 +367,11 @@ public: std::string avatar_url = event.msg.author.get_avatar_url(); easy.escape(avatar_url); std::string user_id_str = std::to_string(static_cast(event.msg.author.id)); + std::string username = event.msg.member.nickname.empty() ? event.msg.author.username : event.msg.member.nickname; // Forms creation curl::curl_pair username_form(CURLFORM_COPYNAME,"username"); - curl::curl_pair username_cont(CURLFORM_COPYCONTENTS,event.msg.member.nickname); + curl::curl_pair username_cont(CURLFORM_COPYCONTENTS,username); curl::curl_pair pass_form(CURLFORM_COPYNAME,"user_id"); curl::curl_pair pass_cont(CURLFORM_COPYCONTENTS,user_id_str); curl::curl_pair av_form(CURLFORM_COPYNAME,"avatar_url"); -- cgit 1.4.1