DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
InteractionEntities.hpp
Go to the documentation of this file.
1/*
2 DiscordCoreAPI, A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
3
4 Copyright 2021, 2022 Chris M. (RealTimeChris)
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 USA
20*/
21/// InteractionEntities.hpp - Header for the interaction related classes and
22/// structs. May 28, 2021 Chris M.
23/// https://discordcoreapi.com
24/// \file InteractionEntities.hpp
25
26#pragma once
27
31
32namespace DiscordCoreAPI {
33
34 /**
35 * \addtogroup foundation_entities
36 * @{
37 */
38
39 using AutoCompleteEntryFunction = std::function<std::string(std::string)>;
40
41 class DiscordCoreAPI_Dll InteractionResponseBase {
42 public:
43 /// \brief Adds a button to the response Message.
44 /// \param disabled Whether the button is active or not.
45 /// \param customIdNew A custom id to give for identifying the button.
46 /// \param buttonLabel A visible label for the button.
47 /// \param buttonStyle The style of the button.
48 /// \param emojiName An emoji name, if desired.
49 /// \param emojiId An emoji id, if desired.
50 /// \param url A url, if applicable.
51 InteractionResponseBase& addButton(bool disabled, const std::string& customIdNew, const std::string& buttonLabel, ButtonStyle buttonStyle,
52 const std::string& emojiName = "", Snowflake emojiId = Snowflake{}, const std::string& url = "");
53
54 /// \brief Adds a select-menu to the response Message.
55 /// \param disabled Whether the select-menu is active or not.
56 /// \param customIdNew A custom id to give for identifying the select-menu.
57 /// \param options A vector of select-menu-options to offer.
58 /// \param placeholder Custom placeholder text if nothing is selected, max 100 characters.
59 /// \param maxValues Maximum number of selections that are possible.
60 /// \param minValues Minimum required number of selections that are required.
61 InteractionResponseBase& addSelectMenu(bool disabled, const std::string& customIdNew, std::vector<SelectOptionData> options,
62 const std::string& placeholder, int32_t maxValues, int32_t minValues, SelectMenuType type,
63 std::vector<ChannelType> channelTypes = std::vector<ChannelType>{});
64
65 /// \brief Adds a modal to the response Message.
66 /// \param topTitleNew A title for the modal.
67 /// \param topCustomIdNew A custom id to give for the modal.
68 /// \param titleNew A title for the modal's individual input.
69 /// \param customIdNew A custom id to give for the modal's individual input.
70 /// \param required Is it a required response?
71 /// \param minLength Minimum length.
72 /// \param maxLength Maximum length.
73 /// \param inputStyle The input style.
74 /// \param label A label for the modal.
75 /// \param placeholder A placeholder for the modal.
76 /// \returns RespondToInputEventData& A reference to this data structure.
77 InteractionResponseBase& addModal(const std::string& topTitleNew, const std::string& topCustomIdNew, const std::string& titleNew,
78 const std::string& customIdNew, bool required, int32_t minLength, int32_t maxLength, TextInputStyle inputStyle,
79 const std::string& label = "", const std::string& placeholder = "");
80
81 /// \brief Adds a file to the current collection of files for this message response.
82 /// \param theFile The file to be added.
83 /// \returns MessageResponseBase& A reference to this data structure.
84 InteractionResponseBase& addFile(const File& theFile);
85
86 /// \brief For setting the allowable mentions in a response.
87 /// \param dataPackage An AllowedMentionsData structure.
88 InteractionResponseBase& addAllowedMentions(const AllowedMentionsData& dataPackage);
89
90 /// \brief For setting the components in a response.
91 /// \param dataPackage An ActionRowData structure.
92 InteractionResponseBase& addComponentRow(const ActionRowData& dataPackage);
93
94 /// \brief Sets the response type of the current Message.
95 /// \param type Interaction callback type.
96 InteractionResponseBase& setResponseType(InteractionCallbackType type);
97
98 /// \brief For setting the embeds in a response.
99 /// \param dataPackage An EmbedData structure.SendDMData
100 InteractionResponseBase& addMessageEmbed(const EmbedData& dataPackage);
101
102 /// \brief For setting the content in a response.
103 /// \param dataPackage A string, containing the content.
104 InteractionResponseBase& addContent(const std::string& dataPackage);
105
106 /// \brief For setting the tts status of a response.
107 /// \param enabledTTs A bool.
108 InteractionResponseBase& setTTSStatus(bool enabledTTs);
109
110 InteractionResponseBase& setFlags(int64_t flag);
111
112 InteractionResponseData getInteractionResponseData();
113
114 virtual ~InteractionResponseBase() noexcept = default;
115
116 protected:
117 InteractionPackageData interactionPackage{};
118 MessagePackageData messagePackage{};
119 InteractionResponseData data{};
120 };
121
122 /// \brief For creating an ephemeral Interaction response.
123 class DiscordCoreAPI_Dll CreateEphemeralInteractionResponseData : public InteractionResponseBase {
124 public:
126 friend class Interactions;
127 friend class InputEvents;
128
130
131 virtual ~CreateEphemeralInteractionResponseData() noexcept = default;
132 };
133
134 /// \brief For creating a deferred Interaction response.
135 class DiscordCoreAPI_Dll CreateDeferredInteractionResponseData : public InteractionResponseBase {
136 public:
138 friend class Interactions;
139 friend class InputEvents;
140
142
143 virtual ~CreateDeferredInteractionResponseData() noexcept = default;
144 };
145
146 /// \brief For creating an Interaction response.
147 class DiscordCoreAPI_Dll CreateInteractionResponseData : public InteractionResponseBase {
148 public:
149 friend class SelectMenuCollector;
150 friend class ButtonCollector;
151 friend class ModalCollector;
152 friend class Interactions;
153 friend class InputEvents;
154
156
158
160
162
163 CreateInteractionResponseData() noexcept = default;
164
165 virtual ~CreateInteractionResponseData() noexcept = default;
166 };
167
168 /// \brief For getting an Interaction response.
169 struct DiscordCoreAPI_Dll GetInteractionResponseData {
170 std::string interactionToken{};///< Interaction token.
171 Snowflake applicationId{};///< application id.
172 };
173
174 /// \brief For editing an Interaction response.
175 class DiscordCoreAPI_Dll EditInteractionResponseData {
176 public:
177 friend class Interactions;
178 friend class InputEvents;
179
181
182 virtual ~EditInteractionResponseData() noexcept = default;
183
184 protected:
185 InteractionPackageData interactionPackage{};
186 EditWebHookData data{};
187 };
188
189 /// \brief For deleting an Interaction response.
190 struct DiscordCoreAPI_Dll DeleteInteractionResponseData {
191 friend class Interactions;
192 friend class InputEvents;
193
195
196 protected:
197 InteractionPackageData interactionPackage{};
198 uint32_t timeDelay{};
199 };
200
201 /// \brief For creating an ephemeral follow up Message.
202 class DiscordCoreAPI_Dll CreateEphemeralFollowUpMessageData : public ExecuteWebHookData {
203 public:
204 friend class CreateFollowUpMessageData;
205 friend class Interactions;
206 friend class InputEvents;
207
209
210 virtual ~CreateEphemeralFollowUpMessageData() noexcept = default;
211
212 protected:
213 InteractionPackageData interactionPackage{};
214 };
215
216 /// \brief For creating a follow up Message.
217 class DiscordCoreAPI_Dll CreateFollowUpMessageData : public ExecuteWebHookData {
218 public:
219 friend class SelectMenuCollector;
220 friend class ButtonCollector;
221 friend class Interactions;
222 friend class InputEvents;
223
225
227
228 virtual ~CreateFollowUpMessageData() noexcept = default;
229
230 protected:
231 InteractionPackageData interactionPackage{};
232 };
233
234 /// \brief For getting a follow-up Message.
235 struct DiscordCoreAPI_Dll GetFollowUpMessageData {
236 std::string interactionToken{};///< Interaction token.
237 Snowflake applicationId{};///< application id.
238 Snowflake messageId{};///< Message id.
239 };
240
241 /// \brief For editing a follow up Message.
242 class DiscordCoreAPI_Dll EditFollowUpMessageData {
243 public:
244 friend class Interactions;
245 friend class InputEvents;
246
248
249 virtual ~EditFollowUpMessageData() noexcept = default;
250
251 protected:
252 InteractionPackageData interactionPackage{};
253 MessagePackageData messagePackage{};
254 EditWebHookData data{};
255 };
256
257 /// \brief For deleting a follow up Message.
258 struct DiscordCoreAPI_Dll DeleteFollowUpMessageData {
259 friend class Interactions;
260 friend class InputEvents;
261
263
264 protected:
265 InteractionPackageData interactionPackage{};
266 MessagePackageData messagePackage{};
267 uint32_t timeDelay{};
268 };
269
270 /// \brief A single Interaction.
271 struct DiscordCoreAPI_Dll Interaction : public InteractionData {
272 public:
273 Interaction() noexcept = default;
274
275 virtual ~Interaction() noexcept = default;
276 };
277
278 /**@}*/
279
280 /**
281 * \addtogroup main_endpoints
282 * @{
283 */
284
285 /// \brief An interface class for the Interaction related Discord endpoints.
286 class DiscordCoreAPI_Dll Interactions {
287 public:
288 friend class DiscordCoreInternal::BaseSocketAgent;
289 friend class DiscordCoreClient;
290 friend class EventManager;
291
292 static void initialize(DiscordCoreInternal::HttpsClient*);
293
294 /// \brief Creates a response to an input Interaction.
295 /// \param dataPackage A CreateInteractionResponseData structure.
296 /// \returns A CoRoutine containing a MessageData.
297 static CoRoutine<Message> createInteractionResponseAsync(CreateInteractionResponseData dataPackage);
298
299 /// \brief Collects an Interaction response.
300 /// \param dataPackage A GetInteractionResponseData structure.
301 /// \returns A CoRoutine containing an InteractionResponseData.
302 static CoRoutine<Message> getInteractionResponseAsync(GetInteractionResponseData dataPackage);
303
304 /// \brief Edits an Interaction response.
305 /// \param dataPackage A EditInteractionResponseData structure.
306 /// \returns A CoRoutine containing a MessageData.
307 static CoRoutine<Message> editInteractionResponseAsync(EditInteractionResponseData dataPackage);
308
309 /// \brief Deletes an Interaction respnose.
310 /// \param dataPackage A DeleteInteractionResponseData structure.
311 /// \returns A CoRoutine containing void.
312 static CoRoutine<void> deleteInteractionResponseAsync(DeleteInteractionResponseData dataPackage);
313
314 /// \brief Creates a follow up Message to an input Interaction.
315 /// \param dataPackage A CreateFollowUpMessageData structure.
316 /// \returns A CoRoutine containing a MessageData.
317 static CoRoutine<Message> createFollowUpMessageAsync(CreateFollowUpMessageData dataPackage);
318
319 /// \brief Creates a follow up Message to an input Interaction.
320 /// \param dataPackage A CreateFollowUpMessageData structure.
321 /// \returns A CoRoutine containing a MessageData.
322 static CoRoutine<Message> getFollowUpMessageAsync(GetFollowUpMessageData dataPackage);
323
324 /// \brief Edits a follow up Message.
325 /// \param dataPackage A EditFollowUpMessageData structure.
326 /// \returns A CoRoutine containing a MessageData.
327 static CoRoutine<Message> editFollowUpMessageAsync(EditFollowUpMessageData dataPackage);
328
329 /// \brief Deletes a follow up Message.
330 /// \param dataPackage A DeleteFollowUpMessageData structure.
331 /// \returns A CoRoutine containing void.
332 static CoRoutine<void> deleteFollowUpMessageAsync(DeleteFollowUpMessageData dataPackage);
333
334 protected:
335 static DiscordCoreInternal::HttpsClient* httpsClient;
336 };
337
338 /**@}*/
339
340 /**
341 * \addtogroup utilities
342 * @{
343 */
344
345 /// \brief Select menu response data.
346 struct DiscordCoreAPI_Dll SelectMenuResponseData {
347 operator InteractionData() {
348 return *this->interactionData;
349 }
350
351 SelectMenuResponseData& operator=(const SelectMenuResponseData& other) {
352 if (this != &other) {
353 *this->interactionData = *other.interactionData;
354 this->selectionId = other.selectionId;
355 this->messageId = other.messageId;
356 this->channelId = other.channelId;
357 this->values = other.values;
358 this->userId = other.userId;
359 }
360 return *this;
361 }
362
364 *this = other;
365 }
366
368 if (this != &other) {
369 *this->interactionData = *other.interactionData;
370 this->selectionId = other.selectionId;
371 this->messageId = other.messageId;
372 this->channelId = other.channelId;
373 this->values = other.values;
374 this->userId = other.userId;
375 }
376 return *this;
377 }
378
380 *this = other;
381 }
382
383 SelectMenuResponseData() noexcept = default;
384
385 std::unique_ptr<InteractionData> interactionData{ std::make_unique<InteractionData>() };///< Interaction data.
386 std::vector<std::string> values{};///< A vector of the chosen values.
387 std::string selectionId{};///< Selection id.
388 Snowflake channelId{};///< The Channel id where it took place.
389 Snowflake messageId{};///< The Message id where it took place.
390 Snowflake userId{};///< The User id who selected the menu options.
391 };
392
393 /// SelectMenuCollector, for collecting select-menu input from one or more
394 /// \brief SelectMenuCollector, for collecting select-menu input from one
395 /// or more Users.
396 class DiscordCoreAPI_Dll SelectMenuCollector {
397 public:
398 friend class DiscordCoreClient;
399
400 static std::unordered_map<std::string, UnboundedMessageBlock<InteractionData>*> selectMenuInteractionBuffersMap;
401 static DiscordCoreInternal::TriggerEvent<void, InteractionData> selectMenuInteractionEventsMap;
402
403 /// \brief Constructor.
404 /// \param dataPackage An InputEventData structure, from the response that came from the submitted select-menu.
406
407 /// \brief Used to collect the select-menu inputs from one or more users.
408 /// \param getSelectMenuDataForAllNew Whether or not to collect select-menu input from a single target User or all potential users.
409 /// \param maxWaitTimeInMsNew The maximum amount of time to wait for new inputs, in milliseconds.
410 /// \param maxCollectedSelectMenuCountNew The maximum number of inputs to collect before stopping.
411 /// \param errorMessageDataNew The message-data for when an individual other than the selected individual attemps to use this interaction.
412 /// \param targetUserId The id of the single User to collect inputs from, if getSelectMenuDataForAllNew is set to false.
413 /// \returns A vector of SelectMenuResponseData.
414 CoRoutine<std::vector<SelectMenuResponseData>> collectSelectMenuData(bool getSelectMenuDataForAllNew, int32_t maxWaitTimeInMsNew,
415 int32_t maxCollectedSelectMenuCountNew, CreateInteractionResponseData errorMessageDataNew, Snowflake targetUserId = Snowflake{});
416
417 /// \brief Used to collect the select-menu inputs from one or more users.
418 /// \param triggerFunctionNew A std::function<bool(InteractionData)> to decide whether or not to trigger the event's main function.
419 /// \param functionNew Takes a DiscordCoreInternal::TriggerEventDelegate<void, InteractionData> as a function to be executed upon returning true from the "trigger-function".
420 void collectSelectMenuData(std::function<bool(InteractionData)> triggerFunctionNew,
422
424
425 protected:
426 std::unique_ptr<InteractionData> interactionData{ std::make_unique<InteractionData>() };
427 UnboundedMessageBlock<InteractionData> selectMenuIncomingInteractionBuffer{};
428 std::vector<SelectMenuResponseData> responseVector{};
429 CreateInteractionResponseData errorMessageData{};
430 int32_t currentCollectedSelectMenuCount{};
431 int32_t maxCollectedSelectMenuCount{};
432 std::vector<std::string> values{};
433 bool getSelectMenuDataForAll{};
434 std::string buffersMapKey{};
435 std::string selectMenuId{};
436 uint32_t maxTimeInMs{};
437 Snowflake channelId{};
438 Snowflake messageId{};
439 Snowflake userId{};
440 bool doWeQuit{};
441
442 void run();
443 };
444
445 /// \brief Button response data.
446 struct DiscordCoreAPI_Dll ButtonResponseData {
447 operator InteractionData() {
448 return *this->interactionData;
449 }
450
451 ButtonResponseData& operator=(const ButtonResponseData& other) {
452 if (this != &other) {
453 *this->interactionData = *other.interactionData;
454 this->messageId = other.messageId;
455 this->channelId = other.channelId;
456 this->emojiName = other.emojiName;
457 this->buttonId = other.buttonId;
458 this->userId = other.userId;
459 }
460 return *this;
461 }
462
464 *this = other;
465 }
466
467 ButtonResponseData& operator=(ButtonResponseData& other) {
468 if (this != &other) {
469 *this->interactionData = *other.interactionData;
470 this->messageId = other.messageId;
471 this->channelId = other.channelId;
472 this->emojiName = other.emojiName;
473 this->buttonId = other.buttonId;
474 this->userId = other.userId;
475 }
476 return *this;
477 }
478
480 *this = other;
481 }
482
483 ButtonResponseData() noexcept = default;
484
485 std::unique_ptr<InteractionData> interactionData{ std::make_unique<InteractionData>() };///< Interaction data.
486 std::string emojiName{};///< The emoji name, if applicable.
487 std::string buttonId{};///< The id of the button, for identification.
488 Snowflake channelId{};///< The Channel id where it took place.
489 Snowflake messageId{};///< The Message id where it took place.
490 Snowflake userId{};///< The User id who selected the menu options.
491 };
492
493 /// \brief ButtonCollector, for collecting button input from one or more Users.
494 class DiscordCoreAPI_Dll ButtonCollector {
495 public:
496 friend class DiscordCoreClient;
497
498 static std::unordered_map<std::string, UnboundedMessageBlock<InteractionData>*> buttonInteractionBuffersMap;
499 static DiscordCoreInternal::TriggerEvent<void, InteractionData> buttonInteractionEventsMap;
500
501 /// \brief Constructor.
502 /// \param dataPackage An InputEventData structure, from the response that came from the submitted button.
503 ButtonCollector(InputEventData& dataPackage);
504
505 /// \brief Used to collect the button inputs from one or more users.
506 /// \param getButtonDataForAllNew Whether or not to collect input from a single target User or all potential users.
507 /// \param maxWaitTimeInMsNew The maximum amount of time to wait for new inputs, in milliseconds.
508 /// \param maxNumberOfPressesNew The maximum number of inputs to collect before stopping.
509 /// \param errorMessageDataNew The message-data for when an individual other than the selected individual attemps to use this interaction.
510 /// \param targetUserId The id of the single User to collect inputs from, if getButtonDataForAllNew is set to false.
511 /// \returns A vector of ButtonResponseData.
512 CoRoutine<std::vector<ButtonResponseData>> collectButtonData(bool getButtonDataForAllNew, int32_t maxWaitTimeInMsNew,
513 int32_t maxNumberOfPressesNew, CreateInteractionResponseData errorMessageDataNew, Snowflake targetUserId = Snowflake{});
514
515 /// \brief Used to collect the button inputs from one or more users.
516 /// \param triggerFunctionNew A std::function<bool(InteractionData)> to decide whether or not to trigger the event's main function.
517 /// \param functionNew Takes a DiscordCoreInternal::TriggerEventDelegate<void, InteractionData> as a function to be executed upon returning true from the "trigger-function".
518 void collectButtonData(std::function<bool(InteractionData)> triggerFunctionNew,
520
522
523 protected:
524 std::unique_ptr<InteractionData> interactionData{ std::make_unique<InteractionData>() };
525 UnboundedMessageBlock<InteractionData> buttonIncomingInteractionBuffer{};
526 CreateInteractionResponseData errorMessageData{};
527 std::vector<ButtonResponseData> responseVector{};
528 int32_t currentCollectedButtonCount{};
529 int32_t maxCollectedButtonCount{};
530 std::vector<std::string> values{};
531 std::string buffersMapKey{};
532 bool getButtonDataForAll{};
533 uint32_t maxTimeInMs{};
534 std::string buttonId{};
535 Snowflake channelId{};
536 Snowflake messageId{};
537 Snowflake userId{};
538 bool doWeQuit{};
539
540 void run();
541 };
542
543 /// \brief Button response data.
544 struct DiscordCoreAPI_Dll ModalResponseData {
545 operator InteractionData() {
546 return *this->interactionData;
547 }
548
549 ModalResponseData& operator=(const ModalResponseData& other) {
550 if (this != &other) {
551 *this->interactionData = *other.interactionData;
552 this->customIdSmall = other.customIdSmall;
553 this->channelId = other.channelId;
554 this->customId = other.customId;
555 this->userId = other.userId;
556 this->value = other.value;
557 }
558 return *this;
559 }
560
562 *this = other;
563 }
564
565 ModalResponseData() noexcept = default;
566
567 std::unique_ptr<InteractionData> interactionData{ std::make_unique<InteractionData>() };///< Interaction data.
568 std::string customIdSmall{};///< The customId of the particular input.
569 std::string customId{};///< The customId of the modal component.
570 Snowflake channelId{};///< The Channel id where it took place.
571 std::string value{};/// The input value of the modal component.
572 Snowflake userId{};///< The User id who selected the menu options.
573 };
574
575 /// \brief ModalCollector, for collecting modal text input from one or more Users.
576 class DiscordCoreAPI_Dll ModalCollector {
577 public:
578 friend class DiscordCoreClient;
579
580 static std::unordered_map<std::string, UnboundedMessageBlock<InteractionData>*> modalInteractionBuffersMap;
581 static DiscordCoreInternal::TriggerEvent<void, InteractionData> modalInteractionEventsMap;
582
583 /// \brief Constructor.
584 /// \param dataPackage An InputEventData structure, from the response that came from the submitted button.
585 ModalCollector(InputEventData& dataPackage);
586
587 /// \brief Used to collect the button inputs from one or more users.
588 /// \param maxWaitTimeInMsNew The maximum amount of time to wait for new inputs, in milliseconds.
589 /// \returns A vector of ButtonResponseData.
590 CoRoutine<ModalResponseData> collectModalData(int32_t maxWaitTimeInMsNew);
591
592 /// \brief Used to collect the modal from one or more users.
593 /// \param triggerFunctionNew A std::function<bool(InteractionData)> to decide whether or not to trigger the event's main function.
594 /// \param functionNew Takes a DiscordCoreInternal::TriggerEventDelegate<void, InteractionData> as a function to be executed upon returning true from the "trigger-function".
595 void collectModalData(std::function<bool(InteractionData)> triggerFunctionNew,
597
599
600 protected:
601 UnboundedMessageBlock<InteractionData> modalIncomingInteractionBuffer{};
602 CreateInteractionResponseData errorMessageData{};
603 int32_t currentCollectedButtonCount{};
604 ModalResponseData responseData{};
605 uint32_t maxTimeInMs{};
606 Snowflake channelId{};
607 bool doWeQuit{};
608
609 void run();
610 };
611
612 /**@}*/
613};// namespace DiscordCoreAPI
The main namespace for this library.
A CoRoutine - representing a potentially asynchronous operation/function.
Definition: CoRoutine.hpp:59
DiscordCoreClient - The main class for this library.
An event that gets fired depending on the result of a "trigger-function" return value.
Class for handling the assignment of event-handling functions.int32_t.
For storing Interaction-related values.
For storing Message-related values.
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 User input - Messages or Interactions.
Definition: InputEvents.hpp:39
For creating an ephemeral Interaction response.
For creating a deferred Interaction response.
For creating an Interaction response.
For getting an Interaction response.
For editing an Interaction response.
For deleting an Interaction response.
For creating an ephemeral follow up Message.
For getting a follow-up Message.
For editing a follow up Message.
An interface class for the Interaction related Discord endpoints.
std::unique_ptr< InteractionData > interactionData
Interaction data.
Snowflake channelId
The Channel id where it took place.
Snowflake userId
The User id who selected the menu options.
Snowflake messageId
The Message id where it took place.
std::vector< std::string > values
A vector of the chosen values.
SelectMenuCollector, for collecting select-menu input from one or more Users.
Snowflake channelId
The Channel id where it took place.
std::unique_ptr< InteractionData > interactionData
Interaction data.
std::string buttonId
The id of the button, for identification.
Snowflake messageId
The Message id where it took place.
Snowflake userId
The User 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 Channel id where it took place.
std::unique_ptr< InteractionData > interactionData
Interaction data.
Snowflake userId
The input value of the modal component.
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.
A thread-safe messaging block for data-structures.
Definition: Utilities.hpp:1645
For editing a WebHook Message.