Created the util.cpp

This commit is contained in:
Mathias Wagner 2023-10-29 16:32:36 +01:00
parent 11a2ff2c5f
commit 4038369e46
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

24
src/api/util.cpp Normal file
View File

@ -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;
}