From 4038369e465ab3d22d708e19cfba5736ed4eabb0 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 29 Oct 2023 16:32:36 +0100 Subject: [PATCH] Created the util.cpp --- src/api/util.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/api/util.cpp diff --git a/src/api/util.cpp b/src/api/util.cpp new file mode 100644 index 0000000..9975640 --- /dev/null +++ b/src/api/util.cpp @@ -0,0 +1,24 @@ +#include "util.h" + +using namespace dpp; + +#define SR_IMAGE "https://i.imgur.com/MV4i9oF.png" + +uint32_t util::getHexColor(EmbedType type) { + switch (type) { + case ERROR: + return 0xde1f1f; + case SUCCESS: + return 0x2ecc71; + case INFO: + return 0x748AD6; + } +} + +embed util::getDefaultEmbed(EmbedType type) { + embed e; + e.set_footer("Sheepstar", SR_IMAGE); + e.set_timestamp(time(nullptr)); + e.set_color(getHexColor(type)); + return e; +} \ No newline at end of file