From ddb17ea01c7f36cf2b80d13c8fc29ee1fe315d3d Mon Sep 17 00:00:00 2001 From: ruslan-ilesik Date: Fri, 15 Sep 2023 12:08:27 -0400 Subject: [PATCH] fix snowflake to 0 comparison in url functions --- src/dpp/utility.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dpp/utility.cpp b/src/dpp/utility.cpp index 0cea7bd544..cd922b1c46 100644 --- a/src/dpp/utility.cpp +++ b/src/dpp/utility.cpp @@ -551,14 +551,14 @@ namespace dpp { } std::string message_url(const snowflake& guild_id, const snowflake& channel_id, const snowflake& message_id){ - if (guild_id == snowflake(0) || channel_id == snowflake(0) || message_id == snowflake(0)) { + if (guild_id.empty() || channel_id.empty() || message_id.empty()) { return ""; } return url_host + "/channels/" + std::to_string(guild_id) + "/" + std::to_string(channel_id) + "/" + std::to_string(message_id); } std::string channel_url(const snowflake& guild_id, const snowflake& channel_id){ - if (guild_id == snowflake(0) || channel_id == snowflake(0)) { + if (guild_id.empty() || channel_id.empty()) { return ""; } return url_host + "/channels/" + std::to_string(guild_id) + "/" + std::to_string(channel_id); @@ -569,7 +569,7 @@ namespace dpp { }; std::string user_url(const snowflake& user_id){ - if (user_id == snowflake(0)) { + if (user_id.empty()) { return ""; } return url_host + "/users/" + std::to_string(user_id);