DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
GuildScheduledEventEntities.hpp
Go to the documentation of this file.
1/*
2 MIT License
3
4 DiscordCoreAPI, A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
5
6 Copyright 2022, 2023 Chris M. (RealTimeChris)
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in all
16 copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 SOFTWARE.
25*/
26/// GuildScheduledEventEntities.hpp - Header for the guild scheduled events stuff.
27/// Nov 27, 2021 Chris M.
28/// https://discordcoreapi.com
29/// \file GuildScheduledEventEntities.hpp
30#pragma once
31
34
35namespace discord_core_api {
36
37 /**
38 * \addtogroup foundation_entities
39 * @{
40 */
41 /// @brief For collecting a list of a guild's scheduled events.
43 bool withUserCount{};///< Do we collect the user counts?
44 snowflake guildId{};///< Guild from which we would like to collect the events.
45 };
46
47 /// @brief For creating a guild_scheduled_event_data.
50 guild_scheduled_event_metadata entityMetadata{};/// the entity metadata of the scheduled event.
51 guild_scheduled_event_entity_type entityType{};///< The entity type of the scheduled event.
52 jsonifier::string scheduledStartTime{};///< The time to schedule the scheduled event.
53 jsonifier::string scheduledEndTime{};///< The time when the scheduled event is scheduled to end.
54 jsonifier::string description{};///< The description of the scheduled event.
55 snowflake channelId{};///< The channel_data id of the scheduled event.
56 snowflake guildId{};///< The guild within which to create the event.
57 jsonifier::string name{};///< The name of the scheduled event.
58 };
59
60 /// @brief For collecting a single guild scheduled event.
62 snowflake guildScheduledEventId{};///< The id of the desired scheduled event.
63 bool withUserCount{};///< Do we collect the user counts?
64 snowflake guildId{};///< Guild from which we would like to collect the events.
65 };
66
67 /// @brief For modifying a single guild scheduled event.
71 guild_scheduled_event_metadata entityMetadata{};///< The entity metadata of the scheduled event.
72 guild_scheduled_event_entity_type entityType{};///< The entity type of the scheduled event.
73 snowflake guildScheduledEventId{};///< The id of the event to modify.
74 jsonifier::string scheduledStartTime{};///< The time to schedule the scheduled event.
75 jsonifier::string scheduledEndTime{};///< The time when the scheduled event is scheduled to end.
76 jsonifier::string description{};///< The description of the scheduled event.
77 snowflake channelId{};///< The channel_data id of the scheduled event, set to null if changing entity type to external.
78 snowflake guildId{};///< The guild within which to modify the event.
79 jsonifier::string name{};///< The name of the scheduled event.
80 };
81
82 /// @brief For deleting a single guild scheduled event.
84 snowflake guildScheduledEventId{};///< The id of the event to modify.
85 snowflake guildId{};///< The guild within which to modify the event.
86 };
87
88 /// @brief For collecting a list of guild scheduled event users.
90 snowflake guildScheduledEventId{};///< The id of the event to modify.
91 snowflake guildId{};///< The guild within which to modify the event.
92 snowflake before{};///< consider only users before given user id.
93 bool withMember{};///< Include guild member responseData if it exists.
94 snowflake after{};///< consider only users after given user id.
95 uint32_t limit{};///< How many users to receive from the event.
96 };
97
98 /**@}*/
99
100 /**
101 * \addtogroup main_endpoints
102 * @{
103 */
104 /// @brief An interface class for the guild_scheduled_event_data related discord endpoints.
105 class DiscordCoreAPI_Dll guild_scheduled_events {
106 public:
107 static void initialize(discord_core_internal::https_client*);
108
109 /// @brief Gets a list of a given guild's scheduled events.
110 /// @param dataPackage a get_guild_scheduled_eventsstructure.
111 /// @return a co_routine containing a vector<guild_scheduled_event_data>.
112 static co_routine<jsonifier::vector<guild_scheduled_event_data>> getGuildScheduledEventsAsync(get_guild_scheduled_events_data dataPackage);
113
114 /// @brief Creates a new guild_scheduled_event_data within a chosen guild.
115 /// @param dataPackage a create_guild_scheduled_event_data structure.
116 /// @return a co_routine containing a guild_scheduled_event_data.
117 static co_routine<guild_scheduled_event_data> createGuildScheduledEventAsync(create_guild_scheduled_event_data dataPackage);
118
119 /// @brief Collects a single guild_scheduled_event_data.
120 /// @param dataPackage a get_guild_scheduled_event_data structure.
121 /// @return a co_routine containing a guild_scheduled_event_data.
122 static co_routine<guild_scheduled_event_data> getGuildScheduledEventAsync(get_guild_scheduled_event_data dataPackage);
123
124 /// @brief Modifies a single guild_scheduled_event_data.
125 /// @param dataPackage a modify_guild_scheduled_event_data structure.
126 /// @return a co_routine containing a guild_scheduled_event_data.
127 static co_routine<guild_scheduled_event_data> modifyGuildScheduledEventAsync(modify_guild_scheduled_event_data dataPackage);
128
129 /// @brief Deletes a single guild_scheduled_event_data.
130 /// @param dataPackage a delete_guild_scheduled_event_data structure.
131 /// @return a co_routine containing void.
132 static co_routine<void> deleteGuildScheduledEventAsync(delete_guild_scheduled_event_data dataPackage);
133
134 /// @brief Collects a list of users for a given guild_scheduled_event_data.
135 /// @param dataPackage a get_guild_scheduled_event_users_data structure.
136 /// @return a co_routine containing a vector<guild_scheduled_event_user>.
137 static co_routine<jsonifier::vector<guild_scheduled_event_user_data>> getGuildScheduledEventUsersAsync(get_guild_scheduled_event_users_data dataPackage);
138
139 protected:
140 static discord_core_internal::https_client* httpsClient;
141 };
142 /**@}*/
143}
An interface class for the guild_scheduled_event_data related discord endpoints.
guild_scheduled_event_status
Guild_scheduled_event_status.
guild_scheduled_event_privacy_level
Guild scheduled event privacy levels.
guild_scheduled_event_entity_type
Guild scheduled event entity types.
The main namespace for the forward-facing interfaces.
jsonifier::string scheduledStartTime
The time to schedule the scheduled event.
jsonifier::string scheduledEndTime
The time when the scheduled event is scheduled to end.
jsonifier::string description
The description of the scheduled event.
snowflake guildId
The guild within which to create the event.
snowflake channelId
The channel_data id of the scheduled event.
guild_scheduled_event_entity_type entityType
the entity metadata of the scheduled event.
jsonifier::string name
The name of the scheduled event.
guild_scheduled_event_privacy_level privacyLevel
The privacy level of the scheduled event.
snowflake guildId
The guild within which to modify the event.
snowflake guildScheduledEventId
The id of the event to modify.
For collecting a single guild scheduled event.
snowflake guildScheduledEventId
The id of the desired scheduled event.
snowflake guildId
Guild from which we would like to collect the events.
For collecting a list of guild scheduled event users.
snowflake before
consider only users before given user id.
bool withMember
Include guild member responseData if it exists.
uint32_t limit
How many users to receive from the event.
snowflake guildId
The guild within which to modify the event.
snowflake after
consider only users after given user id.
For collecting a list of a guild's scheduled events.
snowflake guildId
Guild from which we would like to collect the events.
jsonifier::string scheduledEndTime
The time when the scheduled event is scheduled to end.
jsonifier::string description
The description of the scheduled event.
jsonifier::string name
The name of the scheduled event.
guild_scheduled_event_privacy_level privacyLevel
The privacy level of the scheduled event.
guild_scheduled_event_entity_type entityType
The entity type of the scheduled event.
snowflake guildScheduledEventId
The id of the event to modify.
snowflake guildId
The guild within which to modify the event.
guild_scheduled_event_metadata entityMetadata
The entity metadata of the scheduled event.
guild_scheduled_event_status status
The status of the scheduled event.
snowflake channelId
The channel_data id of the scheduled event, set to null if changing entity type to external.
jsonifier::string scheduledStartTime
The time to schedule the scheduled event.