basic avatars

This commit is contained in:
ouwou
2020-09-10 18:28:42 -04:00
parent 2c5ce3866c
commit 54a8244bfd
11 changed files with 145 additions and 0 deletions

View File

@@ -1,5 +1,13 @@
#include "user.hpp"
bool User::HasAvatar() const {
return Avatar.size() > 0;
}
std::string User::GetAvatarURL(std::string ext, std::string size) const {
return "https://cdn.discordapp.com/avatars/" + std::to_string(ID) + "/" + Avatar + "." + ext + "?size=" + size;
}
void from_json(const nlohmann::json &j, User &m) {
JS_D("id", m.ID);
JS_D("username", m.Username);