File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -115,9 +115,9 @@ std::string user::get_default_avatar_url() const {
115115}
116116
117117std::string user::get_avatar_decoration_url (uint16_t size) const {
118- if (this ->id ) {
118+ if (! this ->avatar_decoration . to_string (). empty () ) {
119119 return utility::cdn_endpoint_url_hash ({ i_png },
120- " avatar-decorations/ " + std::to_string ( this -> id ) , this ->avatar_decoration .to_string (),
120+ " avatar-decoration-presets " , this ->avatar_decoration .to_string (),
121121 i_png, size);
122122 } else {
123123 return std::string ();
@@ -284,9 +284,11 @@ void from_json(const nlohmann::json& j, user& u) {
284284 }
285285 u.avatar = av;
286286
287- u.avatar_decoration = string_not_null (&j, " avatar_decoration" );
287+ if (j.contains (" avatar_decoration_data" ) && !j.at (" avatar_decoration_data" ).is_null ()) {
288+ u.avatar_decoration = string_not_null (&j[" avatar_decoration_data" ], " asset" );
289+ }
288290
289- u.discriminator = ( uint16_t ) snowflake_not_null (&j, " discriminator" );
291+ u.discriminator = int16_not_null (&j, " discriminator" );
290292
291293 u.flags |= bool_not_null (&j, " bot" ) ? dpp::u_bot : 0 ;
292294 u.flags |= bool_not_null (&j, " system" ) ? dpp::u_system : 0 ;
You can’t perform that action at this time.
0 commit comments