summaryrefslogtreecommitdiff
path: root/src/discord/discord.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2024-04-23 22:14:14 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2024-04-23 22:14:14 -0400
commit3dc8fa8e65bdd1bd45dfa0171a06dfbb448baf0d (patch)
treee09e1024813314cc197156bdb80522948e726afa /src/discord/discord.cpp
parent870f05062a87444ee58436e8d12ba3702073eb8e (diff)
downloadabaddon-portaudio-3dc8fa8e65bdd1bd45dfa0171a06dfbb448baf0d.tar.gz
abaddon-portaudio-3dc8fa8e65bdd1bd45dfa0171a06dfbb448baf0d.zip
show thingy topic right away
Diffstat (limited to 'src/discord/discord.cpp')
-rw-r--r--src/discord/discord.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/discord/discord.cpp b/src/discord/discord.cpp
index b3f8ca6..c54583a 100644
--- a/src/discord/discord.cpp
+++ b/src/discord/discord.cpp
@@ -358,6 +358,14 @@ std::optional<WebhookMessageData> DiscordClient::GetWebhookMessageData(Snowflake
return m_store.GetWebhookMessage(message_id);
}
+std::optional<StageInstance> DiscordClient::GetStageInstanceFromChannel(Snowflake channel_id) const {
+ const auto iter1 = m_channel_to_stage_instance.find(channel_id);
+ if (iter1 == m_channel_to_stage_instance.end()) return {};
+ const auto iter2 = m_stage_instances.find(iter1->second);
+ if (iter2 == m_stage_instances.end()) return {};
+ return iter2->second;
+}
+
bool DiscordClient::IsThreadJoined(Snowflake thread_id) const {
return std::find(m_joined_threads.begin(), m_joined_threads.end(), thread_id) != m_joined_threads.end();
}
@@ -1722,6 +1730,7 @@ void DiscordClient::ProcessNewGuild(GuildData &guild) {
if (guild.StageInstances.has_value()) {
for (const auto &stage : *guild.StageInstances) {
+ spdlog::get("discord")->debug("storing stage {} in channel {}", stage.ID, stage.ChannelID);
m_stage_instances[stage.ID] = stage;
m_channel_to_stage_instance[stage.ChannelID] = stage.ID;
}