43 using auto_complete_entry_function = std::function<jsonifier::string(jsonifier::string)>;
45 class DiscordCoreAPI_Dll interaction_response_base {
47 template<
typename value_type>
friend struct jsonifier::core;
49 unordered_set<jsonifier::string> jsonifierExcludedKeys{};
59 interaction_response_base& addButton(
bool disabled, jsonifier::string_view customIdNew, jsonifier::string_view buttonLabel, button_style buttonStyle,
60 jsonifier::string_view emojiName =
"", snowflake emojiId = snowflake{}, jsonifier::string_view url =
"");
69 interaction_response_base& addSelectMenu(
bool disabled, jsonifier::string_view customIdNew, jsonifier::vector<select_option_data> options,
70 jsonifier::string_view placeholder, uint64_t maxValues, uint64_t minValues, select_menu_type type,
71 jsonifier::vector<channel_type> channelTypes = jsonifier::vector<channel_type>{});
85 interaction_response_base& addModal(jsonifier::string_view topTitleNew, jsonifier::string_view topCustomIdNew, jsonifier::string_view titleNew,
86 jsonifier::string_view customIdNew,
bool required, uint64_t minLength, uint64_t maxLength, text_input_style inputStyle, jsonifier::string_view label =
"",
87 jsonifier::string_view placeholder =
"");
92 interaction_response_base& addFile(
const file& theFile);
96 interaction_response_base& addAllowedMentions(
const allowed_mentions_data dataPackage);
100 interaction_response_base& addComponentRow(
const action_row_data dataPackage);
104 interaction_response_base& setResponseType(interaction_callback_type type);
108 interaction_response_base& addMessageEmbed(
const embed_data dataPackage);
112 interaction_response_base& addContent(jsonifier::string_view dataPackage);
116 interaction_response_base& setTTSStatus(
bool enabledTTs);
118 interaction_response_base& setFlags(uint64_t flag);
120 interaction_response_data getInteractionResponseData();
122 void generateExcludedKeys();
124 virtual ~interaction_response_base() =
default;
127 interaction_package_data interactionPackage{};
128 message_package_data messagePackage{};
129 interaction_callback_data data{};
136 friend class create_interaction_response_data;
137 friend class interactions;
138 friend class input_events;
140 create_ephemeral_interaction_response_data(
const respond_to_input_event_data dataPackage);
142 virtual ~create_ephemeral_interaction_response_data() =
default;
148 friend class create_interaction_response_data;
149 friend class interactions;
150 friend class input_events;
152 create_deferred_interaction_response_data(
const respond_to_input_event_data dataPackage);
154 virtual ~create_deferred_interaction_response_data() =
default;
160 template<
typename value_type>
friend struct jsonifier::core;
161 friend class select_menu_collector;
162 friend class button_collector;
163 friend class modal_collector;
164 friend class interactions;
165 friend class input_events;
167 create_interaction_response_data(
const create_ephemeral_interaction_response_data dataPackage);
169 create_interaction_response_data(
const create_deferred_interaction_response_data dataPackage);
171 create_interaction_response_data(
const respond_to_input_event_data dataPackage);
173 create_interaction_response_data(
const interaction_data dataPackage);
175 create_interaction_response_data() =
default;
177 virtual ~create_interaction_response_data() =
default;
189 template<
typename value_type>
friend struct jsonifier::core;
190 friend class interactions;
191 friend class input_events;
193 edit_interaction_response_data(
const respond_to_input_event_data dataPackage);
195 virtual ~edit_interaction_response_data() =
default;
198 interaction_package_data interactionPackage{};
203 friend class interactions;
204 friend class input_events;
206 delete_interaction_response_data(
const respond_to_input_event_data dataPackage);
209 interaction_package_data interactionPackage{};
210 uint32_t timeDelay{};
216 friend class create_follow_up_message_data;
217 friend class interactions;
218 friend class input_events;
220 create_ephemeral_follow_up_message_data(
const respond_to_input_event_data dataPackage);
222 virtual ~create_ephemeral_follow_up_message_data() =
default;
225 interaction_package_data interactionPackage{};
231 template<
typename value_type>
friend struct jsonifier::core;
232 friend class select_menu_collector;
233 friend class button_collector;
234 friend class interactions;
235 friend class input_events;
237 create_follow_up_message_data(
const create_ephemeral_follow_up_message_data dataPackage);
239 create_follow_up_message_data(
const respond_to_input_event_data dataPackage);
241 virtual ~create_follow_up_message_data() =
default;
244 interaction_package_data interactionPackage{};
257 template<
typename value_type>
friend struct jsonifier::core;
258 friend class interactions;
259 friend class input_events;
261 edit_follow_up_message_data(
const respond_to_input_event_data dataPackage);
263 virtual ~edit_follow_up_message_data() =
default;
266 interaction_package_data interactionPackage{};
267 message_package_data messagePackage{};
272 friend class interactions;
273 friend class input_events;
275 delete_follow_up_message_data(
const respond_to_input_event_data dataPackage);
278 interaction_package_data interactionPackage{};
279 message_package_data messagePackage{};
280 uint32_t timeDelay{};
293 friend class discord_core_internal::base_socket_agent;
294 friend class discord_core_client;
295 friend class event_manager;
296 friend class input_events;
298 static void initialize(discord_core_internal::https_client*);
303 static co_routine<message_data> createInteractionResponseAsync(create_interaction_response_data dataPackage);
308 static co_routine<message_data> getInteractionResponseAsync(get_interaction_response_data dataPackage);
313 static co_routine<message_data> editInteractionResponseAsync(edit_interaction_response_data dataPackage);
318 static co_routine<void> deleteInteractionResponseAsync(delete_interaction_response_data dataPackage);
323 static co_routine<message_data> createFollowUpMessageAsync(create_follow_up_message_data dataPackage);
328 static co_routine<message_data> getFollowUpMessageAsync(get_follow_up_message_data dataPackage);
333 static co_routine<message_data> editFollowUpMessageAsync(edit_follow_up_message_data dataPackage);
338 static co_routine<void> deleteFollowUpMessageAsync(delete_follow_up_message_data dataPackage);
341 static discord_core_internal::https_client* httpsClient;
343 static message_data createInteractionResponse(create_interaction_response_data dataPackage);
345 static message_data editInteractionResponse(edit_interaction_response_data dataPackage);
347 static message_data getInteractionResponse(get_interaction_response_data dataPackage);
349 static message_data createFollowUpMessage(create_follow_up_message_data dataPackage);
351 static message_data editFollowUpMessage(edit_follow_up_message_data dataPackage);
363 DCA_INLINE
operator interaction_data() {
367 DCA_INLINE select_menu_response_data& operator=(
const select_menu_response_data& other) {
368 if (
this != &other) {
379 DCA_INLINE select_menu_response_data(
const select_menu_response_data& other) {
383 DCA_INLINE select_menu_response_data& operator=(select_menu_response_data& other) {
384 if (
this != &other) {
395 DCA_INLINE select_menu_response_data(select_menu_response_data& other) {
399 DCA_INLINE select_menu_response_data() =
default;
402 jsonifier::vector<jsonifier::string>
values{};
414 friend class discord_core_client;
416 static unordered_map<jsonifier::string, unbounded_message_block<interaction_data>*> selectMenuInteractionBuffersMap;
417 static discord_core_internal::trigger_event<void, interaction_data> selectMenuInteractionEventsMap;
421 select_menu_collector(input_event_data dataPackage);
430 co_routine<jsonifier::vector<select_menu_response_data>,
false> collectSelectMenuData(
bool getSelectMenuDataForAllNew, uint32_t maxWaitTimeInMsNew,
431 uint32_t maxCollectedSelectMenuCountNew, create_interaction_response_data errorMessageDataNew, snowflake targetUserId = snowflake{});
436 void collectSelectMenuData(std::function<
bool(interaction_data)> triggerFunctionNew, discord_core_internal::trigger_event_delegate<void, interaction_data> functionNew);
438 ~select_menu_collector();
441 unbounded_message_block<interaction_data> selectMenuIncomingInteractionBuffer{};
442 unique_ptr<interaction_data> interactionData{ makeUnique<interaction_data>() };
443 jsonifier::vector<select_menu_response_data> responseVector{};
444 create_interaction_response_data errorMessageData{};
445 jsonifier::vector<jsonifier::string> values{};
446 uint32_t currentCollectedSelectMenuCount{};
447 uint32_t maxCollectedSelectMenuCount{};
448 jsonifier::string buffersMapKey{};
449 jsonifier::string selectMenuId{};
450 bool getSelectMenuDataForAll{};
451 uint32_t maxTimeInMs{};
452 snowflake channelId{};
453 snowflake messageId{};
462 DCA_INLINE
operator interaction_data() {
466 DCA_INLINE button_response_data& operator=(
const button_response_data& other) {
467 if (
this != &other) {
478 DCA_INLINE button_response_data(
const button_response_data& other) {
482 DCA_INLINE button_response_data& operator=(button_response_data& other) {
483 if (
this != &other) {
494 DCA_INLINE button_response_data(button_response_data& other) {
498 DCA_INLINE button_response_data() =
default;
511 friend class discord_core_client;
513 static unordered_map<jsonifier::string, unbounded_message_block<interaction_data>*> buttonInteractionBuffersMap;
514 static discord_core_internal::trigger_event<void, interaction_data> buttonInteractionEventsMap;
518 button_collector(input_event_data dataPackage);
527 co_routine<jsonifier::vector<button_response_data>,
false> collectButtonData(
bool getButtonDataForAllNew, uint32_t maxWaitTimeInMsNew, uint32_t maxNumberOfPressesNew,
528 create_interaction_response_data errorMessageDataNew, snowflake targetUserId = snowflake{});
533 void collectButtonData(std::function<
bool(interaction_data)> triggerFunctionNew, discord_core_internal::trigger_event_delegate<void, interaction_data> functionNew);
538 unique_ptr<interaction_data> interactionData{ makeUnique<interaction_data>() };
539 unbounded_message_block<interaction_data> buttonIncomingInteractionBuffer{};
540 jsonifier::vector<button_response_data> responseVector{};
541 create_interaction_response_data errorMessageData{};
542 jsonifier::vector<jsonifier::string> values{};
543 uint32_t currentCollectedButtonCount{};
544 uint32_t maxCollectedButtonCount{};
545 jsonifier::string buffersMapKey{};
546 bool getButtonDataForAll{};
547 uint32_t maxTimeInMs{};
548 jsonifier::string buttonId{};
549 snowflake channelId{};
550 snowflake messageId{};
559 DCA_INLINE
operator interaction_data() {
563 DCA_INLINE modal_response_data& operator=(
const modal_response_data& other) {
564 if (
this != &other) {
570 values = other.values;
575 DCA_INLINE modal_response_data(
const modal_response_data& other) {
579 DCA_INLINE modal_response_data() =
default;
582 jsonifier::vector<jsonifier::string> values{};
592 friend class discord_core_client;
594 static unordered_map<jsonifier::string, unbounded_message_block<interaction_data>*> modalInteractionBuffersMap;
595 static discord_core_internal::trigger_event<void, interaction_data> modalInteractionEventsMap;
599 modal_collector(input_event_data dataPackage);
604 co_routine<modal_response_data, false> collectModalData(uint32_t maxWaitTimeInMsNew);
609 void collectModalData(std::function<
bool(interaction_data)> triggerFunctionNew, discord_core_internal::trigger_event_delegate<void, interaction_data> functionNew);
614 unbounded_message_block<interaction_data> modalIncomingInteractionBuffer{};
615 create_interaction_response_data errorMessageData{};
616 uint32_t currentCollectedButtonCount{};
617 modal_response_data responseData{};
618 uint32_t maxTimeInMs{};
619 snowflake channelId{};
For creating a deferred interaction response.
For creating an ephemeral follow up message_data.
For creating an ephemeral interaction response.
For creating a follow up message_data.
For creating an interaction response.
For editing a follow up message_data.
For editing an interaction response.
For editing a web_hook message_data.
For executing a web_hook.
An interface class for the interaction_data related discord endpoints.
Modal_collector, for collecting modal text input from one or more users.
interaction_callback_type
Interaction callback types.
DCA_INLINE unique_ptr< value_type, deleter > makeUnique(arg_types &&... args)
Helper function to create a unique_ptr for a non-array object.
The main namespace for the forward-facing interfaces.
For deleting a follow up message_data.
For deleting an interaction response.
For getting a follow-up message_data.
jsonifier::string interactionToken
Interaction token.
snowflake applicationId
Application id.
snowflake messageId
Message id.
For getting an interaction response.
jsonifier::string interactionToken
Interaction token.
snowflake applicationId
Application id.
snowflake userId
The user_data id who selected the menu options.
snowflake channelId
The channel_data id where it took place.
jsonifier::string customIdSmall
the input values of the modal component.
jsonifier::string customId
The customId of the modal component.
unique_ptr< interaction_data > interactionData
Interaction data.