mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-27 16:16:35 +03:00
fix some requests being fired for icons that dont exist
This commit is contained in:
@@ -57,6 +57,10 @@ void from_json(const nlohmann::json &j, Guild &m) {
|
||||
JS_O("approximate_presence_count", m.ApproximatePresenceCount);
|
||||
}
|
||||
|
||||
bool Guild::HasIcon() const {
|
||||
return Icon != "";
|
||||
}
|
||||
|
||||
std::string Guild::GetIconURL(std::string ext, std::string size) const {
|
||||
return "https://cdn.discordapp.com/icons/" + std::to_string(ID) + "/" + Icon + "." + ext + "?size=" + size;
|
||||
}
|
||||
|
||||
@@ -65,5 +65,6 @@ struct Guild {
|
||||
|
||||
friend void from_json(const nlohmann::json &j, Guild &m);
|
||||
|
||||
bool HasIcon() const;
|
||||
std::string GetIconURL(std::string ext = "png", std::string size = "32") const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user