summaryrefslogtreecommitdiff
path: root/src/discord
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-05-30 19:08:35 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2023-05-30 19:08:35 -0400
commit62d04b9993c3a9dca46255857592e0052fef6cdc (patch)
treeeb663400c52ec5885fac59eaa45ab09fa021956d /src/discord
parent366e72cc2a69f2412c74fa6b1768ee6d85fd1032 (diff)
downloadabaddon-portaudio-62d04b9993c3a9dca46255857592e0052fef6cdc.tar.gz
abaddon-portaudio-62d04b9993c3a9dca46255857592e0052fef6cdc.zip
add missing formatter for Snowflake
Diffstat (limited to 'src/discord')
-rw-r--r--src/discord/snowflake.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/discord/snowflake.hpp b/src/discord/snowflake.hpp
index a5c0e6c..83a2bc3 100644
--- a/src/discord/snowflake.hpp
+++ b/src/discord/snowflake.hpp
@@ -2,6 +2,7 @@
#include <cstdint>
#include <nlohmann/json.hpp>
#include <glibmm/ustring.h>
+#include <fmt/core.h>
struct Snowflake {
Snowflake();
@@ -39,6 +40,13 @@ private:
unsigned long long m_num;
};
+template<>
+struct fmt::formatter<Snowflake> : fmt::formatter<std::string> {
+ auto format(Snowflake id, format_context &ctx) -> decltype(ctx.out()) {
+ return format_to(ctx.out(), "[id: {}]", static_cast<uint64_t>(id));
+ }
+};
+
namespace std {
template<>
struct hash<Snowflake> {