Skip to content

Commit

Permalink
fix: removed some exclamation marks, moved emoji fill to one liner
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 committed Jul 21, 2024
1 parent 8699603 commit 9f163de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/dpp/cluster/emoji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void cluster::guild_emojis_get(snowflake guild_id, command_completion_event_t ca

void cluster::application_emojis_get(command_completion_event_t callback) {
/* Because Discord can't be consistent, we can't just do `rest_request_list<emoji>` because all items are behind `items`.
* so now we end up with this duplicating `rest_request_list` because we need to iterate the `items` array!!! Thanks Discord!!!!!!!
* so now we end up with this duplicating `rest_request_list` because we need to iterate the `items` array! Thanks Discord!
*/
post_rest(API_PATH "/application", me.id.str(), "emojis", m_get, "", [this, callback](json &j, const http_request_completion_t& http) {
std::unordered_map<snowflake, emoji> list;
Expand All @@ -56,8 +56,7 @@ void cluster::application_emojis_get(command_completion_event_t callback) {
// No const for `fill_from_json`.
auto emojis_list = j["items"];
for (auto & curr_item : emojis_list) {
emoji t_emoji{};
list[snowflake_not_null(&curr_item, key.c_str())] = t_emoji.fill_from_json(&curr_item);
list[snowflake_not_null(&curr_item, key.c_str())] = emoji().fill_from_json(&curr_item);
}
}
if (callback) {
Expand Down

0 comments on commit 9f163de

Please sign in to comment.