mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
add ability to remove relationships
This commit is contained in:
@@ -691,6 +691,12 @@ std::optional<GuildApplicationData> DiscordClient::GetGuildApplication(Snowflake
|
||||
return it->second;
|
||||
}
|
||||
|
||||
void DiscordClient::RemoveRelationship(Snowflake id, sigc::slot<void(bool success)> callback) {
|
||||
m_http.MakeDELETE("/users/@me/relationships/" + std::to_string(id), [this, callback](const http::response_type &response) {
|
||||
callback(CheckCode(response));
|
||||
});
|
||||
}
|
||||
|
||||
bool DiscordClient::CanModifyRole(Snowflake guild_id, Snowflake role_id, Snowflake user_id) const {
|
||||
const auto guild = *GetGuild(guild_id);
|
||||
if (guild.OwnerID == user_id) return true;
|
||||
@@ -862,6 +868,12 @@ std::unordered_set<Snowflake> DiscordClient::GetRelationships(RelationshipType t
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::optional<RelationshipType> DiscordClient::GetRelationship(Snowflake id) const {
|
||||
if (auto it = m_user_relationships.find(id); it != m_user_relationships.end())
|
||||
return it->second;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void DiscordClient::HandleGatewayMessageRaw(std::string str) {
|
||||
// handles multiple zlib compressed messages, calling HandleGatewayMessage when a full message is received
|
||||
std::vector<uint8_t> buf(str.begin(), str.end());
|
||||
|
||||
Reference in New Issue
Block a user