add menus to dm channels + close/leave dm

This commit is contained in:
ouwou
2021-02-18 18:37:25 -05:00
parent 901028cec9
commit c5bc3455b1
4 changed files with 31 additions and 0 deletions

View File

@@ -436,6 +436,12 @@ void DiscordClient::CreateDM(Snowflake user_id, sigc::slot<void(bool success, Sn
});
}
void DiscordClient::CloseDM(Snowflake channel_id) {
m_http.MakeDELETE("/channels/" + std::to_string(channel_id), [this](const http::response &response) {
CheckCode(response);
});
}
std::optional<Snowflake> DiscordClient::FindDM(Snowflake user_id) {
const auto &channels = m_store.GetChannels();
for (const auto &id : channels) {