mirror of
https://github.com/uowuo/abaddon.git
synced 2024-11-10 06:00:10 +00:00
store stage instances on connect
This commit is contained in:
parent
02fd49b073
commit
870f05062a
@ -1720,6 +1720,13 @@ void DiscordClient::ProcessNewGuild(GuildData &guild) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (guild.StageInstances.has_value()) {
|
||||
for (const auto &stage : *guild.StageInstances) {
|
||||
m_stage_instances[stage.ID] = stage;
|
||||
m_channel_to_stage_instance[stage.ChannelID] = stage.ID;
|
||||
}
|
||||
}
|
||||
|
||||
m_store.BeginTransaction();
|
||||
|
||||
m_store.SetGuild(guild.ID, guild);
|
||||
|
@ -54,6 +54,7 @@ void from_json(const nlohmann::json &j, GuildData &m) {
|
||||
JS_O("preferred_locale", m.PreferredLocale);
|
||||
JS_ON("public_updates_channel_id", m.PublicUpdatesChannelID);
|
||||
JS_O("max_video_channel_users", m.MaxVideoChannelUsers);
|
||||
JS_ON("stage_instances", m.StageInstances);
|
||||
JS_O("approximate_member_count", tmp);
|
||||
if (tmp.has_value())
|
||||
m.ApproximateMemberCount = std::stol(*tmp);
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "role.hpp"
|
||||
#include "channel.hpp"
|
||||
#include "emoji.hpp"
|
||||
#include "stage.hpp"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
@ -90,6 +91,7 @@ struct GuildData {
|
||||
std::optional<int> ApproximateMemberCount;
|
||||
std::optional<int> ApproximatePresenceCount;
|
||||
std::optional<std::vector<ChannelData>> Threads; // only with permissions to view, id only
|
||||
std::optional<std::vector<StageInstance>> StageInstances;
|
||||
|
||||
// undocumented
|
||||
// std::map<std::string, Unknown> GuildHashes;
|
||||
|
Loading…
Reference in New Issue
Block a user