DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
InputEvents.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/// InputEvents.hpp - Header for the input-event handler class.
22/// Aug 18, 2021
23/// https://discordcoreapi.com
24/// \file InputEvents.hpp
25
26#pragma once
27
31
32namespace DiscordCoreAPI {
33
34 /**
35 * \addtogroup main_endpoints
36 * @{
37 */
38 /// \brief For handling User input - Messages or Interactions.
39 class DiscordCoreAPI_Dll InputEvents {
40 public:
41 /// \brief Responds to one of a number of types of "InputEvents".
42 /// \param dataPackage A RespondToInputEventData structure.
43 /// \returns An std::unique_ptr containing an InputEventData structure.
44 static CoRoutine<InputEventData> respondToInputEventAsync(RespondToInputEventData dataPackage);
45
46 /// \brief Deletes a previously sent "input-event-response".
47 /// \param dataPackage A std::unique_ptr containing an InputEventData structure.
48 /// \param timeDelayNew An int32_t representing the desired delay until the message is deleted, in Milliseconds.
49 /// \returns A CoRoutine containing void.
50 static CoRoutine<void> deleteInputEventResponseAsync(InputEventData& dataPackage, int32_t timeDelayNew = 0);
51
52 protected:
53 static InputEventData respondToInputEvent(CreateEphemeralInteractionResponseData& dataPackage);
54
55 static InputEventData respondToInputEvent(CreateDeferredInteractionResponseData& dataPackage);
56
57 static InputEventData respondToInputEvent(CreateEphemeralFollowUpMessageData& dataPackage);
58
59 static InputEventData respondToInputEvent(CreateInteractionResponseData& dataPackage);
60
61 static InputEventData respondToInputEvent(EditInteractionResponseData& dataPackage);
62
63 static InputEventData respondToInputEvent(CreateFollowUpMessageData& dataPackage);
64
65 static InputEventData respondToInputEvent(EditFollowUpMessageData& dataPackage);
66
67 static InputEventData respondToInputEvent(CreateMessageData& dataPackage);
68
69 static InputEventData respondToInputEvent(EditMessageData& dataPackage);
70 };
71 /**@}*/
72}// namespace DiscordCoreAPI
The main namespace for this library.
A CoRoutine - representing a potentially asynchronous operation/function.
Definition: CoRoutine.hpp:52
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 editing an Interaction response.
For creating an ephemeral follow up Message.
For editing a follow up Message.