Merge branch 'master' into friends

This commit is contained in:
ouwou
2021-05-14 03:18:05 -04:00
17 changed files with 161 additions and 83 deletions

View File

@@ -20,7 +20,7 @@ void from_json(const nlohmann::json &j, AuditLogOptions &m) {
void from_json(const nlohmann::json &j, AuditLogEntry &m) {
JS_N("target_id", m.TargetID);
JS_O("changes", m.Changes);
JS_D("user_id", m.UserID);
JS_N("user_id", m.UserID);
JS_D("id", m.ID);
JS_D("action_type", m.Type);
JS_O("options", m.Options);

View File

@@ -40,6 +40,9 @@ enum class AuditLogActionType {
INTEGRATION_CREATE = 80,
INTEGRATION_UPDATE = 81,
INTEGRATION_DELETE = 82,
STAGE_INSTANCE_CREATE = 83,
STAGE_INSTANCE_UPDATE = 84,
STAGE_INSTANCE_DELETE = 85,
};
struct AuditLogChange {
@@ -66,7 +69,7 @@ struct AuditLogOptions {
struct AuditLogEntry {
Snowflake ID;
std::string TargetID; // null
Snowflake UserID;
std::optional<Snowflake> UserID;
AuditLogActionType Type;
std::optional<std::string> Reason;
std::optional<std::vector<AuditLogChange>> Changes;

View File

@@ -21,6 +21,22 @@ enum class ChannelType : int {
GUILD_STAGE_VOICE = 13,
};
enum class StagePrivacy {
PUBLIC = 1,
GUILD_ONLY = 2,
};
constexpr const char *GetStagePrivacyDisplayString(StagePrivacy e) {
switch (e) {
case StagePrivacy::PUBLIC:
return "Public";
case StagePrivacy::GUILD_ONLY:
return "Guild Only";
default:
return "Unknown";
}
}
struct ChannelData {
Snowflake ID;
ChannelType Type;

View File

@@ -102,7 +102,7 @@ void to_json(nlohmann::json &j, const UpdateStatusMessage &m) {
j["d"]["status"] = "online";
break;
case PresenceStatus::Offline:
j["d"]["status"] = "offline";
j["d"]["status"] = "invisible";
break;
case PresenceStatus::Idle:
j["d"]["status"] = "idle";