join/leave guild

This commit is contained in:
ouwou
2020-09-21 18:47:34 -04:00
parent 23b32f8de9
commit 3b4edbfa16
17 changed files with 347 additions and 17 deletions

14
discord/invite.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include "invite.hpp"
void from_json(const nlohmann::json &j, Invite &m) {
JS_D("code", m.Code);
JS_O("channel", m.Channel);
JS_O("inviter", m.Inviter);
JS_O("approximate_member_count", m.Members);
if (j.contains("guild")) {
auto x = j.at("guild");
x.at("id").get_to(m.Guild.ID);
x.at("name").get_to(m.Guild.Name);
}
}