Skip to content

Commit

Permalink
feat: add authorizing_integration_owners
Browse files Browse the repository at this point in the history
  • Loading branch information
raxyte committed Aug 16, 2024
1 parent 3fc8ac0 commit af6361f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/dpp/appcommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*
************************************************************************************/
#pragma once
#include <dpp/integration.h>
#include <dpp/export.h>
#include <dpp/snowflake.h>
#include <dpp/managed.h>
Expand Down Expand Up @@ -972,10 +973,16 @@ class DPP_EXPORT interaction : public managed, public json_interface<interaction
virtual json to_json_impl(bool with_id = false) const;

public:
/**
* @brief Context where the interaction was triggered from
*/
std::map<application_integration_types, snowflake> authorizing_integration_owners;

/**
* @brief Context where the interaction was triggered from
*/
std::optional<interaction_context_type> context;

/**
* @brief ID of the application this interaction is for.
*/
Expand Down
4 changes: 4 additions & 0 deletions src/dpp/slashcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,10 @@ void from_json(const nlohmann::json& j, interaction& i) {
i.context = static_cast<interaction_context_type>(*it);
}

if (auto it = j.find("authorizing_integration_owners"); it != j.end()) {
it->get_to(i.authorizing_integration_owners);
}

if(j.contains("entitlements")) {
for (auto& entitle : j["entitlements"]) {
i.entitlements.emplace_back(entitlement().fill_from_json(const_cast<json*>(&entitle)));
Expand Down

0 comments on commit af6361f

Please sign in to comment.