37namespace DiscordCoreAPI {
44 using AutoCompleteEntryFunction = std::function<std::string(std::string)>;
46 class DiscordCoreAPI_Dll InteractionResponseBase {
48 template<
typename ValueType>
friend struct jsonifier::core;
50 UnorderedSet<std::string_view> excludedKeys{};
60 InteractionResponseBase& addButton(
bool disabled,
const std::string& customIdNew,
const std::string& buttonLabel, ButtonStyle buttonStyle,
61 const std::string& emojiName =
"", Snowflake emojiId = Snowflake{},
const std::string& url =
"");
70 InteractionResponseBase& addSelectMenu(
bool disabled,
const std::string& customIdNew, jsonifier::vector<SelectOptionData> options,
const std::string& placeholder,
71 uint64_t maxValues, uint64_t minValues, SelectMenuType type, jsonifier::vector<ChannelType> channelTypes = jsonifier::vector<ChannelType>{});
85 InteractionResponseBase& addModal(
const std::string& topTitleNew,
const std::string& topCustomIdNew,
const std::string& titleNew,
const std::string& customIdNew,
86 bool required, uint64_t minLength, uint64_t maxLength, TextInputStyle inputStyle,
const std::string& label =
"",
const std::string& placeholder =
"");
91 InteractionResponseBase& addFile(
const File& theFile);
95 InteractionResponseBase& addAllowedMentions(
const AllowedMentionsData& dataPackage);
99 InteractionResponseBase& addComponentRow(
const ActionRowData& dataPackage);
103 InteractionResponseBase& setResponseType(InteractionCallbackType type);
107 InteractionResponseBase& addMessageEmbed(
const EmbedData& dataPackage);
111 InteractionResponseBase& addContent(
const std::string& dataPackage);
115 InteractionResponseBase& setTTSStatus(
bool enabledTTs);
117 InteractionResponseBase& setFlags(uint64_t flag);
119 InteractionResponseData getInteractionResponseData();
121 void generateExcludedKeys();
123 virtual ~InteractionResponseBase() =
default;
126 InteractionPackageData interactionPackage{};
127 MessagePackageData messagePackage{};
128 InteractionCallbackData data{};
159 template<
typename ValueType>
friend struct jsonifier::core;
188 template<
typename ValueType>
friend struct jsonifier::core;
192 UnorderedSet<std::string_view> excludedKeys{};
196 void generateExcludedKeys();
213 uint32_t timeDelay{};
234 template<
typename ValueType>
friend struct jsonifier::core;
240 UnorderedSet<std::string_view> excludedKeys{};
246 void generateExcludedKeys();
264 template<
typename ValueType>
friend struct jsonifier::core;
268 UnorderedSet<std::string_view> excludedKeys{};
289 uint32_t timeDelay{};
302 friend class DiscordCoreInternal::BaseSocketAgent;
307 static void initialize(DiscordCoreInternal::HttpsClient*);
350 static DiscordCoreInternal::HttpsClient* httpsClient;
375 if (
this != &other) {
391 if (
this != &other) {
423 static UnorderedMap<std::string, UnboundedMessageBlock<InteractionData>*> selectMenuInteractionBuffersMap;
450 jsonifier::vector<SelectMenuResponseData> responseVector{};
452 uint32_t currentCollectedSelectMenuCount{};
453 jsonifier::vector<std::string> values{};
454 uint32_t maxCollectedSelectMenuCount{};
455 bool getSelectMenuDataForAll{};
456 std::string buffersMapKey{};
457 std::string selectMenuId{};
458 uint32_t maxTimeInMs{};
474 if (
this != &other) {
490 if (
this != &other) {
520 static UnorderedMap<std::string, UnboundedMessageBlock<InteractionData>*> buttonInteractionBuffersMap;
547 jsonifier::vector<ButtonResponseData> responseVector{};
549 jsonifier::vector<std::string> values{};
550 uint32_t currentCollectedButtonCount{};
551 uint32_t maxCollectedButtonCount{};
552 std::string buffersMapKey{};
553 bool getButtonDataForAll{};
554 uint32_t maxTimeInMs{};
555 std::string buttonId{};
571 if (
this != &other) {
601 static UnorderedMap<std::string, UnboundedMessageBlock<InteractionData>*> modalInteractionBuffersMap;
623 uint32_t currentCollectedButtonCount{};
625 uint32_t maxTimeInMs{};
InteractionCallbackType
Interaction callback types.
A CoRoutine - representing a potentially asynchronous operation/function.
DiscordCoreClient - The main class for this library.
Class for handling the assignment of event-handling functions.int32_t.
For storing Interaction-related values.
For storing MessageData-related values.
Data structure representing a single MessageData.
Data representing an input-event, which is any Message or Interaction that is coming into the bot as ...
Data for responding to an input-event.
For handling UserData input - Messages or Interactions.
For creating an ephemeral Interaction response.
For creating a deferred Interaction response.
For creating an Interaction response.
For getting an Interaction response.
std::string interactionToken
Interaction token.
Snowflake applicationId
application id.
For editing an Interaction response.
For deleting an Interaction response.
For creating an ephemeral follow up MessageData.
For creating a follow up MessageData.
For getting a follow-up MessageData.
Snowflake messageId
Message id.
std::string interactionToken
Interaction token.
Snowflake applicationId
application id.
For editing a follow up MessageData.
For deleting a follow up MessageData.
An interface class for the Interaction related Discord endpoints.
Select menu response data.
jsonifier::vector< std::string > values
A vector of the chosen values.
UniquePtr< InteractionData > interactionData
Interaction data.
Snowflake channelId
The ChannelData id where it took place.
Snowflake userId
The UserData id who selected the menu options.
std::string selectionId
Selection id.
Snowflake messageId
The Message id where it took place.
SelectMenuCollector, for collecting select-menu input from one or more Users.
Snowflake channelId
The ChannelData id where it took place.
std::string buttonId
The id of the button, for identification.
UniquePtr< InteractionData > interactionData
Interaction data.
Snowflake messageId
The Message id where it took place.
Snowflake userId
The UserData id who selected the menu options.
std::string emojiName
The emoji name, if applicable.
ButtonCollector, for collecting button input from one or more Users.
Snowflake channelId
The ChannelData id where it took place.
Snowflake userId
The input value of the modal component.
UniquePtr< InteractionData > interactionData
Interaction data.
std::string customIdSmall
The customId of the particular input.
std::string customId
The customId of the modal component.
ModalCollector, for collecting modal text input from one or more Users.
For editing a WebHook MessageData.
A class representing a Snowflake identifier with various operations.
Event-delegate, for representing an event-function to be executed conditionally.
A trigger event that fires based on the result of trigger-function return value.
A thread-safe messaging block for data-structures.
A smart pointer class that provides unique ownership semantics.