mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
progress 2
This commit is contained in:
@@ -1,11 +1,24 @@
|
||||
#include "message.hpp"
|
||||
|
||||
void to_json(nlohmann::json &j, const EmbedFooterData &m) {
|
||||
j["text"] = m.Text;
|
||||
JS_IF("icon_url", m.IconURL);
|
||||
JS_IF("proxy_icon_url", m.ProxyIconURL);
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, EmbedFooterData &m) {
|
||||
JS_D("text", m.Text);
|
||||
JS_O("icon_url", m.IconURL);
|
||||
JS_O("proxy_icon_url", m.ProxyIconURL);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json &j, const EmbedImageData &m) {
|
||||
JS_IF("url", m.URL);
|
||||
JS_IF("proxy_url", m.ProxyURL);
|
||||
JS_IF("height", m.Height);
|
||||
JS_IF("width", m.Width);
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, EmbedImageData &m) {
|
||||
JS_O("url", m.URL);
|
||||
JS_O("proxy_url", m.ProxyURL);
|
||||
@@ -13,6 +26,13 @@ void from_json(const nlohmann::json &j, EmbedImageData &m) {
|
||||
JS_O("width", m.Width);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json &j, const EmbedThumbnailData &m) {
|
||||
JS_IF("url", m.URL);
|
||||
JS_IF("proxy_url", m.ProxyURL);
|
||||
JS_IF("height", m.Height);
|
||||
JS_IF("width", m.Width);
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, EmbedThumbnailData &m) {
|
||||
JS_O("url", m.URL);
|
||||
JS_O("proxy_url", m.ProxyURL);
|
||||
@@ -20,17 +40,35 @@ void from_json(const nlohmann::json &j, EmbedThumbnailData &m) {
|
||||
JS_O("width", m.Width);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json &j, const EmbedVideoData &m) {
|
||||
JS_IF("url", m.URL);
|
||||
JS_IF("height", m.Height);
|
||||
JS_IF("width", m.Width);
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, EmbedVideoData &m) {
|
||||
JS_O("url", m.URL);
|
||||
JS_O("height", m.Height);
|
||||
JS_O("width", m.Width);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json &j, const EmbedProviderData &m) {
|
||||
JS_IF("name", m.Name);
|
||||
JS_IF("url", m.URL);
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, EmbedProviderData &m) {
|
||||
JS_O("name", m.Name);
|
||||
JS_ON("url", m.URL);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json &j, const EmbedAuthorData &m) {
|
||||
JS_IF("name", m.Name);
|
||||
JS_IF("url", m.URL);
|
||||
JS_IF("icon_url", m.IconURL);
|
||||
JS_IF("proxy_icon_url", m.ProxyIconURL);
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, EmbedAuthorData &m) {
|
||||
JS_O("name", m.Name);
|
||||
JS_O("url", m.URL);
|
||||
@@ -38,12 +76,34 @@ void from_json(const nlohmann::json &j, EmbedAuthorData &m) {
|
||||
JS_O("proxy_icon_url", m.ProxyIconURL);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json &j, const EmbedFieldData &m) {
|
||||
j["name"] = m.Name;
|
||||
j["value"] = m.Value;
|
||||
JS_IF("inline", m.Inline);
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, EmbedFieldData &m) {
|
||||
JS_D("name", m.Name);
|
||||
JS_D("value", m.Value);
|
||||
JS_O("inline", m.Inline);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json &j, const EmbedData &m) {
|
||||
JS_IF("title", m.Title);
|
||||
JS_IF("type", m.Type);
|
||||
JS_IF("description", m.Description);
|
||||
JS_IF("url", m.URL);
|
||||
JS_IF("timestamp", m.Timestamp);
|
||||
JS_IF("color", m.Color);
|
||||
JS_IF("footer", m.Footer);
|
||||
JS_IF("image", m.Image);
|
||||
JS_IF("thumbnail", m.Thumbnail);
|
||||
JS_IF("video", m.Video);
|
||||
JS_IF("provider", m.Provider);
|
||||
JS_IF("author", m.Author);
|
||||
JS_IF("fields", m.Fields);
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, EmbedData &m) {
|
||||
JS_O("title", m.Title);
|
||||
JS_O("type", m.Type);
|
||||
@@ -60,6 +120,16 @@ void from_json(const nlohmann::json &j, EmbedData &m) {
|
||||
JS_O("fields", m.Fields);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json &j, const AttachmentData &m) {
|
||||
j["id"] = m.ID;
|
||||
j["filename"] = m.Filename;
|
||||
j["size"] = m.Bytes;
|
||||
j["url"] = m.URL;
|
||||
j["proxy_url"] = m.ProxyURL;
|
||||
JS_IF("height", m.Height);
|
||||
JS_IF("width", m.Width);
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, AttachmentData &m) {
|
||||
JS_D("id", m.ID);
|
||||
JS_D("filename", m.Filename);
|
||||
@@ -107,7 +177,7 @@ void from_json(const nlohmann::json &j, Message &m) {
|
||||
JS_D("type", m.Type);
|
||||
// JS_O("activity", m.Activity);
|
||||
// JS_O("application", m.Application);
|
||||
// JS_O("message_reference", m.MessageReference);
|
||||
JS_O("message_reference", m.MessageReference);
|
||||
JS_O("flags", m.Flags);
|
||||
JS_O("stickers", m.Stickers);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user