DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
EventManager.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/// EventManager.hpp - Header for the event manager class.
27/// Apr 26, 2021
28/// https://discordcoreapi.com
29/// \file EventManager.hpp
30#pragma once
31
44
45namespace discord_core_api {
46
47 /**
48 * \addtogroup discord_events
49 * @{
50 */
51
52 template<typename value_type> struct event_data {
53 public:
54 value_type value{};
55 };
56
57 template<typename value_type, typename old_value_type> struct updated_event_data {
58 public:
59 old_value_type oldValue{};
60 value_type value{};
61 };
62
63 struct guild_member_remove_data {
64 snowflake guildId{};
65 user_data user{};
66 };
67
68 struct guild_ban_add_data {
69 snowflake guildId{};
70 user_data user{};
71 };
72
73 struct guild_ban_remove_data {
74 snowflake guildId{};
75 user_data user{};
76 };
77
78 struct role_creation_data {
79 snowflake guildId{};
80 role_data role{};
81 };
82
83 struct role_update_data {
84 snowflake guildId{};
85 role_data role{};
86 };
87
88 struct role_deletion_data {
89 snowflake guildId{};
90 role_data role{};
91 };
92
93 struct guild_scheduled_event_user_add_data {
94 snowflake guildScheduledEventId{};
95 snowflake guildId{};
96 snowflake userId{};
97 };
98
99 struct guild_scheduled_event_user_remove_data {
100 snowflake guildScheduledEventId{};
101 snowflake guildId{};
102 snowflake userId{};
103 };
104
105 struct integration_creation_data {
106 integration_data integrationData{};///< The new integration_data structure.
107 snowflake guildId{};///< The id of the guild for which this integration was created.
108 };
109
110 struct integration_update_data {
111 integration_data integrationData{};///< New integration_data structure.
112 snowflake guildId{};///< The id of the guild for which the integration was updated.
113 };
114
115 struct integration_deletion_data {
116 snowflake applicationId{};///< Application id of the current application.
117 snowflake guildId{};///< The id of the guild for which the integration was deleted.
118 snowflake id{};///< The id of the deleted integration.
119 };
120
121 struct invite_deletion_data {
122 snowflake channelId{};///< The id of the channel for which the invite existed.
123 snowflake guildId{};///< The id of the guild for which the invite existed.
124 jsonifier::string code{};///< The code of the invite.
125 };
126
127 struct message_deletion_data {
128 snowflake messageId{};///< The id of the message which was deleted.
129 snowflake channelId{};///< The id of the channel from which the message was deleted.
130 snowflake guildId{};///< The id of the guild from which the message was deleted.
131 };
132
133 struct message_deletion_bulk_data {
134 jsonifier::vector<snowflake> ids{};///< A vector containing the list of deleted message ids.
135 snowflake channelId{};///< The id of the channel from which the message was deleted.
136 snowflake guildId{};///< The id of the guild from which the message was deleted.
137 };
138
139 struct reaction_remove_all_data {
140 snowflake channelId{};///< The id of the channel from which the reactions were deleted.
141 snowflake messageId{};///< The id of the message from which the reactions were deleted.
142 snowflake guildId{};///< The id of the guild from which the reactions were deleted.
143 };
144
145 struct reaction_remove_emoji_data {
146 snowflake messageId{};///< The id of the message from which the reactions were deleted.
147 snowflake channelId{};///< The id of the channel from which the reactions were deleted.
148 snowflake guildId{};///< The id of the guild from which the reactions were deleted.
149 emoji_data emoji{};///< The id of the emoji which was removed from the message_data.
150 };
151
152 struct web_hook_update_data {
153 snowflake channelId{};///< Id of the channel for which the web_hook update is occurring.
154 snowflake guildId{};///< Id of the guild for which the web_hook update is occurring.
155 };
156
157 /// @brief Data that is received as part of a gateway ping event.
158 struct on_gateway_ping_data : public event_data<int32_t> {
159 int32_t timeUntilNextPing{};///< The number of milliseconds until the next ping.
160 };
161
162 /// @brief Data that is received as part of an input_event creation event.
163 struct DiscordCoreAPI_Dll on_input_event_creation_data : public event_data<input_event_data> {
164 on_input_event_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
165 };
166
167 /// @brief Data that is received as part of an application_command_permissions update event.
168 struct DiscordCoreAPI_Dll on_application_command_permissions_update_data : public event_data<guild_application_command_permissions_data> {
169 on_application_command_permissions_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
170 };
171
172 /// @brief Data that is received as part of an auto_moderation_rule_data creation event.
173 struct DiscordCoreAPI_Dll on_auto_moderation_rule_creation_data : public event_data<auto_moderation_rule_data> {
174 on_auto_moderation_rule_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
175 };
176
177 /// @brief Data that is received as part of an auto_moderation_rule_data update event.
178 struct DiscordCoreAPI_Dll on_auto_moderation_rule_update_data : public event_data<auto_moderation_rule_data> {
179 on_auto_moderation_rule_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
180 };
181
182 /// @brief Data that is received as part of an auto_moderation_rule_data delete event.
183 struct DiscordCoreAPI_Dll on_auto_moderation_rule_deletion_data : public event_data<auto_moderation_rule_data> {
184 on_auto_moderation_rule_deletion_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
185 };
186
187 /// @brief Data that is received as part of an auto_moderation_action execution event.
188 struct DiscordCoreAPI_Dll on_auto_moderation_action_execution_data : public event_data<auto_moderation_action_execution_event_data> {
189 on_auto_moderation_action_execution_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
190 };
191
192 /// @brief Data that is received as part of a channel creation event.
193 struct DiscordCoreAPI_Dll on_channel_creation_data : public event_data<channel_data> {
194 on_channel_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
195 };
196
197 /// @brief Data that is received as part of a channel update event.
198 struct DiscordCoreAPI_Dll on_channel_update_data : public updated_event_data<channel_data, channel_data> {
199 on_channel_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
200 };
201
202 /// @brief Data that is received as part of a channel deletion event.
203 struct DiscordCoreAPI_Dll on_channel_deletion_data : public event_data<channel_data> {
204 on_channel_deletion_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
205 };
206
207 /// @brief Data that is received as part of a channel pins update event.
208 struct DiscordCoreAPI_Dll on_channel_pins_update_data : public event_data<channel_pins_update_event_data> {
209 on_channel_pins_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
210 };
211
212 /// @brief Data that is received as part of a thread_data creation event.
213 struct DiscordCoreAPI_Dll on_thread_creation_data : public event_data<thread_data> {
214 on_thread_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
215 };
216
217 /// @brief Data that is received as part of a thread_data update event.
218 struct DiscordCoreAPI_Dll on_thread_update_data : public event_data<thread_data> {
219 on_thread_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
220 };
221
222 /// @brief Data that is received as part of a thread_data deletion event.
223 struct DiscordCoreAPI_Dll on_thread_deletion_data : public event_data<thread_data> {
224 on_thread_deletion_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
225 };
226
227 /// @brief Data that is received as part of a thread_data list sync event.
228 struct DiscordCoreAPI_Dll on_thread_list_sync_data : public event_data<thread_list_sync_data> {
229 on_thread_list_sync_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
230 };
231
232 /// @brief Data that is received as part of a thread_data member update event.
233 struct DiscordCoreAPI_Dll on_thread_member_update_data : public event_data<thread_member_data> {
234 on_thread_member_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
235 };
236
237 /// @brief Data that is received as part of a thread_data members update event.
238 struct DiscordCoreAPI_Dll on_thread_members_update_data : public event_data<thread_members_update_data> {
239 on_thread_members_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
240 };
241
242 /// @brief Data that is received as part of a guild creation event.
243 struct DiscordCoreAPI_Dll on_guild_creation_data : public event_data<guild_data> {
244 on_guild_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
245 };
246
247 /// @brief Data that is received as part of a guild update event.
248 struct DiscordCoreAPI_Dll on_guild_update_data : public updated_event_data<guild_data, guild_data> {
249 on_guild_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
250 };
251
252 /// @brief Data that is received as part of a guild deletion event.
253 struct DiscordCoreAPI_Dll on_guild_deletion_data : public event_data<guild_data> {
254 on_guild_deletion_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
255 };
256
257 /// @brief Data that is received as part of a guild ban add event.
258 struct DiscordCoreAPI_Dll on_guild_ban_add_data : public event_data<guild_ban_add_data> {
259 on_guild_ban_add_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
260 };
261
262 /// @brief Data that is received as part of a guild ban add event.
263 struct DiscordCoreAPI_Dll on_guild_ban_remove_data : public event_data<guild_ban_remove_data> {
264 on_guild_ban_remove_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
265 };
266
267 /// @brief Data that is received as part of a guild emojis update event.
268 struct DiscordCoreAPI_Dll on_guild_emojis_update_data : public event_data<guild_emojis_update_event_data> {
269 on_guild_emojis_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
270 };
271
272 /// @brief Data that is received as part of a guild sticker update event.
273 struct DiscordCoreAPI_Dll on_guild_stickers_update_data : public event_data<guild_stickers_update_event_data> {
274 on_guild_stickers_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
275 };
276
277 /// @brief Data that is received as part of a guild integration update event.
278 struct DiscordCoreAPI_Dll on_guild_integrations_update_data : public event_data<snowflake> {
279 on_guild_integrations_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
280 };
281
282 /// @brief Data that is received as part of a guild_member add event.
283 struct DiscordCoreAPI_Dll on_guild_member_add_data : public event_data<guild_member_data> {
284 on_guild_member_add_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
285 };
286
287 /// @brief Data that is received as part of a guild_member update event.
288 struct DiscordCoreAPI_Dll on_guild_member_update_data : public updated_event_data<guild_member_data, guild_member_data> {
289 on_guild_member_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
290 };
291
292 /// @brief Data that is received as part of a guild_member remove event.
293 struct DiscordCoreAPI_Dll on_guild_member_remove_data : public event_data<guild_member_remove_data> {
294 on_guild_member_remove_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
295 };
296
297 /// @brief Data that is received as part of a guild_members chunk event.
298 struct DiscordCoreAPI_Dll on_guild_members_chunk_data : public event_data<guild_members_chunk_event_data> {
299 on_guild_members_chunk_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
300 };
301
302 /// @brief Data that is received as part of a role_data creation event.
303 struct DiscordCoreAPI_Dll on_role_creation_data : public event_data<role_creation_data> {
304 on_role_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
305 };
306
307 /// @brief Data that is received as part of a role_data update event.
308 struct DiscordCoreAPI_Dll on_role_update_data : public updated_event_data<role_update_data, role_data> {
309 on_role_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
310 };
311
312 /// @brief Data that is received as part of a role_data deletion event.
313 struct DiscordCoreAPI_Dll on_role_deletion_data : public event_data<role_deletion_data> {
314 on_role_deletion_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
315 };
316
317 /// @brief Data that is received as part of a guild_scheduled_event_data creation event.
318 struct DiscordCoreAPI_Dll on_guild_scheduled_event_creation_data : public event_data<guild_scheduled_event_data> {
319 on_guild_scheduled_event_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
320 };
321
322 /// @brief Data that is received as part of a guild_scheduled_event_data update event.
323 struct DiscordCoreAPI_Dll on_guild_scheduled_event_update_data : public event_data<guild_scheduled_event_data> {
324 on_guild_scheduled_event_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
325 };
326
327 /// @brief Data that is received as part of a guild_scheduled_event_data delete event.
328 struct DiscordCoreAPI_Dll on_guild_scheduled_event_deletion_data : public event_data<guild_scheduled_event_data> {
329 on_guild_scheduled_event_deletion_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
330 };
331
332 /// @brief Data that is received as part of a guild_scheduled_event_data user add event.
333 struct DiscordCoreAPI_Dll on_guild_scheduled_event_user_add_data : public event_data<guild_scheduled_event_user_add_data> {
334 on_guild_scheduled_event_user_add_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
335 };
336
337 /// @brief Data that is received as part of a guild_scheduled_event_data user remove event.
338 struct DiscordCoreAPI_Dll on_guild_scheduled_event_user_remove_data : public event_data<guild_scheduled_event_user_remove_data> {
339 on_guild_scheduled_event_user_remove_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
340 };
341
342 /// @brief Data that is received as part of an integration creation event.
343 struct DiscordCoreAPI_Dll on_integration_creation_data : public event_data<integration_creation_data> {
344 on_integration_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
345 };
346
347 /// @brief Data that is received as part of an integration update event.
348 struct DiscordCoreAPI_Dll on_integration_update_data : public event_data<integration_update_data> {
349 on_integration_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
350 };
351
352 /// @brief Data that is received as part of an integration deletion event.
353 struct DiscordCoreAPI_Dll on_integration_deletion_data : public event_data<integration_deletion_data> {
354 on_integration_deletion_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
355 };
356
357 /// @brief Data that is received as part of an invite creation event.
358 struct DiscordCoreAPI_Dll on_invite_creation_data : public event_data<invite_data> {
359 on_invite_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
360 };
361
362 /// @brief Data that is received as part of an invite deletion event.
363 struct DiscordCoreAPI_Dll on_invite_deletion_data : public event_data<invite_deletion_data> {
364 on_invite_deletion_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
365 };
366
367 /// @brief Data that is received as part of an interaction creation event.
368 struct DiscordCoreAPI_Dll on_interaction_creation_data : public event_data<interaction_data> {
369 on_interaction_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
370 };
371
372 /// @brief Data that is received as part of a message creation event.
373 struct DiscordCoreAPI_Dll on_message_creation_data : public event_data<message_data> {
374 on_message_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
375 };
376
377 /// @brief Data that is received as part of a message update event.
378 struct DiscordCoreAPI_Dll on_message_update_data : public event_data<message_data> {
379 on_message_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
380 };
381
382 /// @brief Data that is received as part of a message deletion event.
383 struct DiscordCoreAPI_Dll on_message_deletion_data : public event_data<message_deletion_data> {
384 on_message_deletion_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
385 };
386
387 /// @brief Data that is received as part of a message delete bulk event.
388 struct DiscordCoreAPI_Dll on_message_delete_bulk_data : public event_data<message_deletion_bulk_data> {
389 on_message_delete_bulk_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
390 };
391
392 /// @brief Data that is received as part of a reaction add event.
393 struct DiscordCoreAPI_Dll on_reaction_add_data : public event_data<reaction_data> {
394 on_reaction_add_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
395 };
396
397 /// @brief Data that is received as part of a reaction remove event.
398 struct DiscordCoreAPI_Dll on_reaction_remove_data : public event_data<reaction_remove_data> {
399 reaction_remove_data reactionRemoveData{};///< The reaction_remove_data.
400 on_reaction_remove_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
401 };
402
403 /// @brief Data that is received as part of a reaction remove all event.
404 struct DiscordCoreAPI_Dll on_reaction_remove_all_data : public event_data<reaction_remove_all_data> {
405 on_reaction_remove_all_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
406 };
407
408 /// @brief Data that is received as part of a reaction remove emoji event.
409 struct DiscordCoreAPI_Dll on_reaction_remove_emoji_data : public event_data<reaction_remove_emoji_data> {
410 on_reaction_remove_emoji_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
411 };
412
413 /// @brief Data that is received as part of a presence update event.
414 struct DiscordCoreAPI_Dll on_presence_update_data : public event_data<presence_update_data> {
415 on_presence_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
416 };
417
418 /// @brief Data that is received as part of a stage_instance_data creation event.
419 struct DiscordCoreAPI_Dll on_stage_instance_creation_data : public event_data<stage_instance_data> {
420 on_stage_instance_creation_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
421 };
422
423 /// @brief Data that is received as part of a stage_instance_data update event.
424 struct DiscordCoreAPI_Dll on_stage_instance_update_data : public event_data<stage_instance_data> {
425 on_stage_instance_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
426 };
427
428 /// @brief Data that is received as part of a stage_instance_data deletion event.
429 struct DiscordCoreAPI_Dll on_stage_instance_deletion_data : public event_data<stage_instance_data> {
430 on_stage_instance_deletion_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
431 };
432
433 /// @brief Data that is received as part of a typing start event.
434 struct DiscordCoreAPI_Dll on_typing_start_data : public event_data<typing_start_data> {
435 on_typing_start_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
436 };
437
438 /// @brief Data that is received as part of a user update event.
439 struct DiscordCoreAPI_Dll on_user_update_data : public updated_event_data<user_data, user_data> {
440 on_user_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
441 };
442
443 /// @brief Data that is received as part of a voice state update event.
444 struct DiscordCoreAPI_Dll on_voice_state_update_data : public event_data<voice_state_data> {
445 on_voice_state_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse, discord_core_internal::websocket_client* sslShard);
446 };
447
448 /// @brief Data that is received as part of a voice server update event.
449 struct DiscordCoreAPI_Dll on_voice_server_update_data : public event_data<voice_server_update_data> {
450 on_voice_server_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse, discord_core_internal::websocket_client* sslShard);
451 };
452
453 /// @brief Data that is received as part of a web_hook update event.
454 struct DiscordCoreAPI_Dll on_webhook_update_data : public event_data<web_hook_update_data> {
455 on_webhook_update_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
456 };
457
458 /// @brief Data that is received upon the bot receiving an autocomplete entry.
459 struct DiscordCoreAPI_Dll on_auto_complete_entry_data : public event_data<input_event_data> {
460 on_auto_complete_entry_data(jsonifier::jsonifier_core<false>& parserNew, jsonifier::string_view_base<uint8_t> dataToParse);
461 };
462
463 /// @brief Class for handling the assignment of event-handling functions.int32_t
464 class DiscordCoreAPI_Dll event_manager {
465 public:
466 /// @brief For adding a function to handle this event.
467 /// @param handler a delegate taking an on_gateway_ping_data structure as an argument.
468 /// @return an event_token for later de-registering the event.
469 discord_core_internal::event_delegate_token onGatewayPing(discord_core_internal::event_delegate<co_routine<void>, const on_gateway_ping_data&> handler);
470 /// @brief For removing a function from handling this event.
471 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
472 void onGatewayPing(discord_core_internal::event_delegate_token& token);
473
474 /// @brief For adding a function to handle this event.
475 /// @param handler a delegate taking an on_application_command_permissions_update_data structure as an argument.
476 /// @return an event_token for later de-registering the event.
477 discord_core_internal::event_delegate_token onApplicationCommandsPermissionsUpdate(
478 discord_core_internal::event_delegate<co_routine<void>, const on_application_command_permissions_update_data&> handler);
479 /// @brief For removing a function from handling this event.
480 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
481 void onApplicationCommandsPermissionsUpdate(discord_core_internal::event_delegate_token& token);
482
483 /// @brief For adding a function to handle this event.
484 /// @param handler a delegate taking an on_auto_moderation_rule_creation_data structure as an argument.
485 /// @return an event_token for later de-registering the event.
486 discord_core_internal::event_delegate_token onAutoModerationRuleCreation(
487 discord_core_internal::event_delegate<co_routine<void>, const on_auto_moderation_rule_creation_data&> handler);
488 /// @brief For removing a function from handling this event.
489 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
490 void onAutoModerationRuleCreation(discord_core_internal::event_delegate_token& token);
491
492 /// @brief For adding a function to handle this event.
493 /// @param handler a delegate taking an on_auto_moderation_rule_update_data structure as an argument.
494 /// @return an event_token for later de-registering the event.
495 discord_core_internal::event_delegate_token onAutoModerationRuleUpdate(
496 discord_core_internal::event_delegate<co_routine<void>, const on_auto_moderation_rule_update_data&> handler);
497 /// @brief For removing a function from handling this event.
498 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
499 void onAutoModerationRuleUpdate(discord_core_internal::event_delegate_token& token);
500
501 /// @brief For adding a function to handle this event.
502 /// @param handler a delegate taking an on_auto_moderation_rule_deletion_data structure as an argument.
503 /// @return an event_token for later de-registering the event.
504 discord_core_internal::event_delegate_token onAutoModerationRuleDeletion(
505 discord_core_internal::event_delegate<co_routine<void>, const on_auto_moderation_rule_deletion_data&> handler);
506 /// @brief For removing a function from handling this event.
507 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
508 void onAutoModerationRuleDeletion(discord_core_internal::event_delegate_token& token);
509
510 /// @brief For adding a function to handle this event.
511 /// @param handler a delegate taking an on_auto_moderation_action_execution_data structure as an argument.
512 /// @return an event_token for later de-registering the event.
513 discord_core_internal::event_delegate_token onAutoModerationActionExecution(
514 discord_core_internal::event_delegate<co_routine<void>, const on_auto_moderation_action_execution_data&> handler);
515 /// @brief For removing a function from handling this event.
516 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
517 void onAutoModerationActionExecution(discord_core_internal::event_delegate_token& token);
518
519 /// @brief For adding a function to handle this event.
520 /// @param handler a delegate taking an on_input_event_creation_data structure as an argument.
521 /// @return an event_token for later de-registering the event.
522 discord_core_internal::event_delegate_token onAutoCompleteEntry(discord_core_internal::event_delegate<co_routine<void>, const on_auto_complete_entry_data&> handler);
523 /// @brief For removing a function from handling this event.
524 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
525 void onAutoCompleteEntry(discord_core_internal::event_delegate_token& token);
526
527 /// @brief For adding a function to handle this event.
528 /// @param handler a delegate taking an on_input_event_creation_data structure as an argument.
529 /// @return an event_token for later de-registering the event.
530 discord_core_internal::event_delegate_token onInputEventCreation(discord_core_internal::event_delegate<co_routine<void>, const on_input_event_creation_data&> handler);
531 /// @brief For removing a function from handling this event.
532 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
533 void onInputEventCreation(discord_core_internal::event_delegate_token& token);
534
535 /// @brief For adding a function to handle this event.
536 /// @param handler a delegate taking an on_channel_creation_data structure as an argument.
537 /// @return an event_token for later de-registering the event.
538 discord_core_internal::event_delegate_token onChannelCreation(discord_core_internal::event_delegate<co_routine<void>, const on_channel_creation_data&> handler);
539 /// @brief For removing a function from handling this event.
540 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
541 void onChannelCreation(discord_core_internal::event_delegate_token& token);
542
543 /// @brief For adding a function to handle this event.
544 /// @param handler a delegate taking an on_channel_update_data structure as an argument.
545 /// @return an event_token for later de-registering the event.
546 discord_core_internal::event_delegate_token onChannelUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_channel_update_data&> handler);
547 /// @brief For removing a function from handling this event.
548 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
549 void onChannelUpdate(discord_core_internal::event_delegate_token& token);
550
551 /// @brief For adding a function to handle this event.
552 /// @param handler a delegate taking an on_channel_deletion_data structure as an argument.
553 /// @return an event_token for later de-registering the event.
554 discord_core_internal::event_delegate_token onChannelDeletion(discord_core_internal::event_delegate<co_routine<void>, const on_channel_deletion_data&> handler);
555 /// @brief For removing a function from handling this event.
556 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
557 void onChannelDeletion(discord_core_internal::event_delegate_token& token);
558
559 /// @brief For adding a function to handle this event.
560 /// @param handler a delegate taking an on_channel_pins_update_data structure as an argument.
561 /// @return an event_token for later de-registering the event.
562 discord_core_internal::event_delegate_token onChannelPinsUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_channel_pins_update_data&> handler);
563 /// @brief For removing afunction from handling this event.
564 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
565 void onChannelPinsUpdate(discord_core_internal::event_delegate_token& token);
566
567 /// @brief For adding a function to handle this event.
568 /// @param handler a delegate taking an on_thread_creation_data structure as an argument.
569 /// @return an event_token for later de-registering the event.
570 discord_core_internal::event_delegate_token onThreadCreation(discord_core_internal::event_delegate<co_routine<void>, const on_thread_creation_data&> handler);
571 /// @brief For removing a function from handling this event.
572 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
573 void onThreadCreation(discord_core_internal::event_delegate_token& token);
574
575 /// @brief For adding a function to handle this event.
576 /// @param handler a delegate taking an on_thread_update_data structure as an argument.
577 /// @return an event_token for later de-registering the event.
578 discord_core_internal::event_delegate_token onThreadUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_thread_update_data&> handler);
579 /// @brief For removing a function from handling this event.
580 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
581 void onThreadUpdate(discord_core_internal::event_delegate_token& token);
582
583 /// @brief For adding a function to handle this event.
584 /// @param handler a delegate taking an on_thread_deletion_data structure as an argument.
585 /// @return an event_token for later de-registering the event.
586 discord_core_internal::event_delegate_token onThreadDeletion(discord_core_internal::event_delegate<co_routine<void>, const on_thread_deletion_data&> handler);
587 /// @brief For removing a function from handling this event.
588 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
589 void onThreadDeletion(discord_core_internal::event_delegate_token& token);
590
591 /// @brief For adding a function to handle this event.
592 /// @param handler a delegate taking an on_thread_list_sync_data structure as an argument.
593 /// @return an event_token for later de-registering the event.
594 discord_core_internal::event_delegate_token onThreadListSync(discord_core_internal::event_delegate<co_routine<void>, const on_thread_list_sync_data&> handler);
595 /// @brief For removing a function from handling this event.
596 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
597 void onThreadListSync(discord_core_internal::event_delegate_token& token);
598
599 /// @brief For adding a function to handle this event.
600 /// @param handler a delegate taking an on_thread_member_update_data structure as an argument.
601 /// @return an event_token for later de-registering the event.
602 discord_core_internal::event_delegate_token onThreadMemberUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_thread_member_update_data&> handler);
603 /// @brief For removing a function from handling this event.
604 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
605 void onThreadMemberUpdate(discord_core_internal::event_delegate_token& token);
606
607 /// @brief For adding a function to handle this event.
608 /// @param handler a delegate taking an on_thread_members_update_data structure as an argument
609 /// @return an event_token for later de-registering the event.
610 discord_core_internal::event_delegate_token onThreadMembersUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_thread_members_update_data&> handler);
611 /// @brief For removing a function from handling this event.
612 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
613 void onThreadMembersUpdate(discord_core_internal::event_delegate_token& token);
614
615 /// @brief For adding a function to handle this event.
616 /// @param handler a delegate taking an on_guild_creation_data structure as an argument.
617 /// @return an event_token for later de-registering the event.
618 discord_core_internal::event_delegate_token onGuildCreation(discord_core_internal::event_delegate<co_routine<void>, const on_guild_creation_data&> handler);
619 /// @brief For removing a function from handling this event.
620 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
621 void onGuildCreation(discord_core_internal::event_delegate_token& token);
622
623 /// @brief For adding a function to handle this event.
624 /// @param handler a delegate taking an on_guild_update_data structure as an argument.
625 /// @return an event_token for later de-registering the event.
626 discord_core_internal::event_delegate_token onGuildUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_guild_update_data&> handler);
627 /// @brief For removing a function from handling this event.
628 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
629 void onGuildUpdate(discord_core_internal::event_delegate_token& token);
630
631 /// @brief For adding a function to handle this event.
632 /// @param handler a delegate taking an on_guild_deletion_data structure as an argument
633 /// @return an event_token for later de-registering the event.
634 discord_core_internal::event_delegate_token onGuildDeletion(discord_core_internal::event_delegate<co_routine<void>, const on_guild_deletion_data&> handler);
635 /// @brief For removing a function from handling this event.
636 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
637 void onGuildDeletion(discord_core_internal::event_delegate_token& token);
638
639 /// @brief For adding a function to handle this event.
640 /// @param handler a delegate taking an on_guild_ban_add_data structure as an argument.
641 /// @return an event_token for later de-registering the event.
642 discord_core_internal::event_delegate_token onGuildBanAdd(discord_core_internal::event_delegate<co_routine<void>, const on_guild_ban_add_data&> handler);
643 /// @brief For removing a function from handling this event.
644 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
645 void onGuildBanAdd(discord_core_internal::event_delegate_token& token);
646
647 /// @brief For adding a function to handle this event.
648 /// @param handler a delegate taking an on_guild_ban_remove_data structure as an argument.
649 /// @return an event_token for later de-registering the event.
650 discord_core_internal::event_delegate_token onGuildBanRemove(discord_core_internal::event_delegate<co_routine<void>, const on_guild_ban_remove_data&> handler);
651 /// @brief For removing a function from handling this event.
652 /// @param token discord_core_internal::event_delegate_token, from the original event registration.
653 void onGuildBanRemove(discord_core_internal::event_delegate_token& token);
654
655 /// @brief For adding a function to handle this event.
656 /// @param handler a delegate taking an on_guild_emojis_update_data structure as an argument.
657 /// @return an event_token for later de-registering the event.
658 discord_core_internal::event_delegate_token onGuildEmojisUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_guild_emojis_update_data&> handler);
659 /// @brief For removing a function from handling this event.
660 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
661 void onGuildEmojisUpdate(discord_core_internal::event_delegate_token& token);
662
663 /// @brief For adding a function to handle this event.
664 /// @param handler a delegate taking an on_guild_stickers_update_data structure as an argument.
665 /// @return an event_token for later de-registering the event.
666 discord_core_internal::event_delegate_token onGuildStickersUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_guild_stickers_update_data&> handler);
667 /// @brief For removing a function from handling this event.
668 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
669 void onGuildStickersUpdate(discord_core_internal::event_delegate_token& token);
670
671 /// @brief For adding a function to handle this event.
672 /// @param handler a delegate taking an on_guild_integrations_update_data structure as an argument.
673 /// @return an event_token for later de-registering the event.
674 discord_core_internal::event_delegate_token onGuildIntegrationsUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_guild_integrations_update_data&> handler);
675 /// @brief For removing a function from handling this event.
676 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
677 void onGuildIntegrationsUpdate(discord_core_internal::event_delegate_token& token);
678
679 /// @brief For adding a function to handle this event.
680 /// @param handler a delegate taking an on_guild_members_chunk_data structure as an argument.
681 /// @return an discord_core_internal::event_delegate_token, > for later de-registering the event.
682 discord_core_internal::event_delegate_token onGuildMembersChunk(discord_core_internal::event_delegate<co_routine<void>, const on_guild_members_chunk_data&> handler);
683 /// @brief For removing a function from handling this event.
684 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
685 void onGuildMembersChunk(discord_core_internal::event_delegate_token& token);
686
687 /// @brief For adding a function to handle this event.
688 /// @param handler a delegate taking an on_guild_member_add_data structure as an argument.
689 /// @return an event_token for later de-registering the event.
690 discord_core_internal::event_delegate_token onGuildMemberAdd(discord_core_internal::event_delegate<co_routine<void>, const on_guild_member_add_data&> handler);
691 /// @brief For removing a function from handling this event.
692 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
693 void onGuildMemberAdd(discord_core_internal::event_delegate_token& token);
694
695 /// @brief For adding a function to handle this event.
696 /// @param handler a delegate taking an on_guild_member_remove_data structure as an argument.
697 /// @return an event_token for later de-registering the event.
698 discord_core_internal::event_delegate_token onGuildMemberRemove(discord_core_internal::event_delegate<co_routine<void>, const on_guild_member_remove_data&> handler);
699 /// @brief For removing a function from handling this event.
700 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
701 void onGuildMemberRemove(discord_core_internal::event_delegate_token& token);
702
703 /// @brief For adding a function to handle this event.
704 /// @param handler a delegate taking an on_guild_member_update_data structure as an argument.
705 /// @return an event_token for later de-registering the event.
706 discord_core_internal::event_delegate_token onGuildMemberUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_guild_member_update_data&> handler);
707 /// @brief For removing a function from handling this event.
708 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
709 void onGuildMemberUpdate(discord_core_internal::event_delegate_token& token);
710
711 /// @brief For adding a function to handle this event.
712 /// @param handler a delegate taking an on_role_creation_data structure as an argument.
713 /// @return an event_token for later de-registering the event.
714 discord_core_internal::event_delegate_token onRoleCreation(discord_core_internal::event_delegate<co_routine<void>, const on_role_creation_data&> handler);
715 /// @brief For removing a function from handling this event.
716 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
717 void onRoleCreation(discord_core_internal::event_delegate_token& token);
718
719 /// @brief For adding a function to handle this event.
720 /// @param handler a delegate taking an on_role_update_data structure as an argument
721 /// @return an event_token for later de-registering the event.
722 discord_core_internal::event_delegate_token onRoleUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_role_update_data&> handler);
723 /// @brief For removing a function from handling this event.
724 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
725 void onRoleUpdate(discord_core_internal::event_delegate_token& token);
726
727 /// @brief For adding a function to handle this event.
728 /// @param handler a delegate taking an on_role_deletion_data structure as an argument.
729 /// @return an event_token for later de-registering the event.
730 discord_core_internal::event_delegate_token onRoleDeletion(discord_core_internal::event_delegate<co_routine<void>, const on_role_deletion_data&> handler);
731 /// @brief For removing a function from handling this event.
732 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
733 void onRoleDeletion(discord_core_internal::event_delegate_token& token);
734
735 /// @brief For adding a function to handle this event.
736 /// @param handler a delegate taking an on_guild_scheduled_event_creation_data structure as an argument.
737 /// @return an event_token for later de-registering the event.
738 discord_core_internal::event_delegate_token onGuildScheduledEventCreation(
739 discord_core_internal::event_delegate<co_routine<void>, const on_guild_scheduled_event_creation_data&> handler);
740 /// @brief For removing a function from handling this event.
741 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
742 void onGuildScheduledEventCreation(discord_core_internal::event_delegate_token& token);
743
744 /// @brief For adding a function to handle this event.
745 /// @param handler a delegate taking an on_guild_scheduled_event_update_data structure as an argument.
746 /// @return an event_token for later de-registering the event.
747 discord_core_internal::event_delegate_token onGuildScheduledEventUpdate(
748 discord_core_internal::event_delegate<co_routine<void>, const on_guild_scheduled_event_update_data&> handler);
749 /// @brief For removing a function from handling this event.
750 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
751 void onGuildScheduledEventUpdate(discord_core_internal::event_delegate_token& token);
752
753 /// @brief For adding a function to handle this event.
754 /// @param handler a delegate taking an on_guild_scheduled_event_deletion_data structure as an argument.
755 /// @return an event_token for later de-registering the event.
756 discord_core_internal::event_delegate_token onGuildScheduledEventDeletion(
757 discord_core_internal::event_delegate<co_routine<void>, const on_guild_scheduled_event_deletion_data&> handler);
758 /// @brief For removing a function from handling this event.
759 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
760 void onGuildScheduledEventDeletion(discord_core_internal::event_delegate_token& token);
761
762 /// @brief For adding a function to handle this event.
763 /// @param handler a delegate taking an on_guild_scheduled_event_user_add_data structure as an argument.
764 /// @return an event_token for later de-registering the event.
765 discord_core_internal::event_delegate_token onGuildScheduledEventUserAdd(
766 discord_core_internal::event_delegate<co_routine<void>, const on_guild_scheduled_event_user_add_data&> handler);
767 /// @brief For removing a function from handling this event.
768 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
769 void onGuildScheduledEventUserAdd(discord_core_internal::event_delegate_token& token);
770
771 /// @brief For adding a function to handle this event.
772 /// @param handler a delegate taking an on_guild_scheduled_event_user_remove_data structure as an argument.
773 /// @return an event_token for later de-registering the event.
774 discord_core_internal::event_delegate_token onGuildScheduledEventUserRemove(
775 discord_core_internal::event_delegate<co_routine<void>, const on_guild_scheduled_event_user_remove_data&> handler);
776 /// @brief For removing a function from handling this event.
777 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
778 void onGuildScheduledEventUserRemove(discord_core_internal::event_delegate_token& token);
779
780 /// @brief For adding a function to handle this event.
781 /// @param handler a delegate taking an on_integration_creation_data structure as an argument.
782 /// @return an event_token for later de-registering the event.
783 discord_core_internal::event_delegate_token onIntegrationCreation(discord_core_internal::event_delegate<co_routine<void>, const on_integration_creation_data&> handler);
784 /// @brief For removing a function from handling this event.
785 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
786 void onIntegrationCreation(discord_core_internal::event_delegate_token& token);
787
788 /// @brief For adding a function to handle this event.
789 /// @param handler a delegate taking an on_integration_update_data structure as an argument.
790 /// @return an event_token for later de-registering the event.
791 discord_core_internal::event_delegate_token onIntegrationUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_integration_update_data&> handler);
792 /// @brief For removing a function from handling this event.
793 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
794 void onIntegrationUpdate(discord_core_internal::event_delegate_token& token);
795
796 /// @brief For adding a function to handle this event.
797 /// @param handler a delegate taking an on_integration_deletion_data structure as an argument.
798 /// @return an event_token for later de-registering the event.
799 discord_core_internal::event_delegate_token onIntegrationDeletion(discord_core_internal::event_delegate<co_routine<void>, const on_integration_deletion_data&> handler);
800 /// @brief For removing a function from handling this event.
801 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
802 void onIntegrationDeletion(discord_core_internal::event_delegate_token& token);
803
804 /// @brief For adding a function to handle this event.
805 /// @param handler a delegate taking an on_interaction_creation_data structure as an argument.
806 /// @return an event_token for later de-registering the event.
807 discord_core_internal::event_delegate_token onInteractionCreation(discord_core_internal::event_delegate<co_routine<void>, const on_interaction_creation_data&> handler);
808 /// @brief For removing a function from handling this event.
809 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
810 void onInteractionCreation(discord_core_internal::event_delegate_token& token);
811
812 /// @brief For adding a function to handle this event.
813 /// @param handler a delegate taking an on_invite_creation_data structure as an argument.
814 /// @return an event_token for later de-registering the event.
815 discord_core_internal::event_delegate_token onInviteCreation(discord_core_internal::event_delegate<co_routine<void>, const on_invite_creation_data&> handler);
816 /// @brief For removing a function from handling this event.
817 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
818 void onInviteCreation(discord_core_internal::event_delegate_token& token);
819
820 /// @brief For adding a function to handle this event.
821 /// @param handler a delegate taking an on_invite_deletion_data structure as an argument.
822 /// @return an event_token for later de-registering the event.
823 discord_core_internal::event_delegate_token onInviteDeletion(discord_core_internal::event_delegate<co_routine<void>, const on_invite_deletion_data&> handler);
824 /// @brief For removing a function from handling this event.
825 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
826 void onInviteDeletion(discord_core_internal::event_delegate_token& token);
827
828 /// @brief For adding a function to handle this event.
829 /// @param handler a delegate taking an on_message_creation_data structure as an argument.
830 /// @return an event_token for later de-registering the event.
831 discord_core_internal::event_delegate_token onMessageCreation(discord_core_internal::event_delegate<co_routine<void>, const on_message_creation_data&> handler);
832 /// @brief For removing a function from handling this event.
833 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
834 void onMessageCreation(discord_core_internal::event_delegate_token& token);
835
836 /// @brief For adding a function to handle this event.
837 /// @param handler a delegate taking an on_message_update_data structure as an argument.
838 /// @return an event_token for later de-registering the event.
839 discord_core_internal::event_delegate_token onMessageUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_message_update_data&> handler);
840 /// @brief For removing a function from handling this event.
841 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
842 void onMessageUpdate(discord_core_internal::event_delegate_token& token);
843
844 /// @brief For adding a function to handle this event.
845 /// @param handler a delegate taking an on_message_deletion_data structure as an argument.
846 /// @return an event_token for later de-registering the event.
847 discord_core_internal::event_delegate_token onMessageDeletion(discord_core_internal::event_delegate<co_routine<void>, const on_message_deletion_data&> handler);
848 /// @brief For removing a function from handling this event.
849 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
850 void onMessageDeletion(discord_core_internal::event_delegate_token& token);
851
852 /// @brief For adding a function to handle this event.
853 /// @param handler a delegate taking an on_message_delete_bulk_data structure as an argument.
854 /// @return an event_token for later de-registering the event.
855 discord_core_internal::event_delegate_token onMessageDeleteBulk(discord_core_internal::event_delegate<co_routine<void>, const on_message_delete_bulk_data&> handler);
856 /// @brief For removing a function from handling this event.
857 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
858 void onMessageDeleteBulk(discord_core_internal::event_delegate_token& token);
859
860 /// @brief For adding a function to handle this event.
861 /// @param handler a delegate taking an on_reaction_add_data structure as an argument.
862 /// @return an event_token for later de-registering the event.
863 discord_core_internal::event_delegate_token onReactionAdd(discord_core_internal::event_delegate<co_routine<void>, const on_reaction_add_data&> handler);
864 /// @brief For removing a function from handling this event.
865 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
866 void onReactionAdd(discord_core_internal::event_delegate_token& token);
867
868 /// @brief For adding a function to handle this event.
869 /// @param handler a delegate taking an on_reaction_remove_data structure as an argument.
870 /// @return an event_token for later de-registering the event.
871 discord_core_internal::event_delegate_token onReactionRemove(discord_core_internal::event_delegate<co_routine<void>, const on_reaction_remove_data&> handler);
872 /// @brief For removing a function from handling this event.
873 /// @param token an discord_core_internal::event_delegate_token,from the original event registration.
874 void onReactionRemove(discord_core_internal::event_delegate_token& token);
875
876 /// @brief For adding a function to handle this event.
877 /// @param handler a delegate taking an on_reaction_remove_all_data structure as an argument.
878 /// @return an event_token for later de-registering the event.
879 discord_core_internal::event_delegate_token onReactionRemoveAll(discord_core_internal::event_delegate<co_routine<void>, const on_reaction_remove_all_data&> handler);
880 /// @brief For removing a function from handling this event.
881 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
882 void onReactionRemoveAll(discord_core_internal::event_delegate_token& token);
883
884 /// @brief For adding a function to handle this event.
885 /// @param handler a delegate taking an on_reaction_remove_emoji_data structure as an argument.
886 /// @return an event_token for later de-registering the event.
887 discord_core_internal::event_delegate_token onReactionRemoveEmoji(discord_core_internal::event_delegate<co_routine<void>, const on_reaction_remove_emoji_data&> handler);
888 /// @brief For removing a function from handling this event.
889 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
890 void onReactionRemoveEmoji(discord_core_internal::event_delegate_token& token);
891
892 /// @brief For adding a function to handle this event.
893 /// @param handler a delegate taking an on_presence_update_data structure as an argument.
894 /// @return an event_token for later de-registering the event.
895 discord_core_internal::event_delegate_token onPresenceUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_presence_update_data&> handler);
896 /// @brief For removing a function from handling this event.
897 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
898 void onPresenceUpdate(discord_core_internal::event_delegate_token& token);
899
900 /// @brief For adding a function to handle this event.
901 /// @param handler a delegate taking an on_stage_instance_creation_data structure as an argument.
902 /// @return an event_token for later de-registering the event.
903 discord_core_internal::event_delegate_token onStageInstanceCreation(discord_core_internal::event_delegate<co_routine<void>, const on_stage_instance_creation_data&> handler);
904 /// @brief For removing a function from handling this event.
905 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
906 void onStageInstanceCreation(discord_core_internal::event_delegate_token& token);
907
908 /// @brief For adding a function to handle this event.
909 /// @param handler a delegate taking an on_stage_instance_update_data structure as an argument.
910 /// @return an event_token for later de-registering the event.
911 discord_core_internal::event_delegate_token onStageInstanceUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_stage_instance_update_data&> handler);
912 /// @brief For removing a function from handling this event.
913 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
914 void onStageInstanceUpdate(discord_core_internal::event_delegate_token& token);
915
916 /// @brief For adding a function to handle this event.
917 /// @param handler a delegate taking an on_stage_instance_deletion_data structure as an argument.
918 /// @return an event_token for later de-registering the event.
919 discord_core_internal::event_delegate_token onStageInstanceDeletion(discord_core_internal::event_delegate<co_routine<void>, const on_stage_instance_deletion_data&> handler);
920 /// @brief For removing a function from handling this event.
921 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
922 void onStageInstanceDeletion(discord_core_internal::event_delegate_token& token);
923
924 /// @brief For adding a function to handle this event.
925 /// @param handler a delegate taking an on_typing_start_data structure as an argument.
926 /// @return an event_token for later de-registering the event.
927 discord_core_internal::event_delegate_token onTypingStart(discord_core_internal::event_delegate<co_routine<void>, const on_typing_start_data&> handler);
928 /// @brief For removing a function from handling this event.
929 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
930 void onTypingStart(discord_core_internal::event_delegate_token& token);
931
932 /// @brief For adding a function to handle this event.
933 /// @param handler a delegate taking an on_user_update_data structure as an argument.
934 /// @return an event_token for later de-registering the event.
935 discord_core_internal::event_delegate_token onUserUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_user_update_data&> handler);
936 /// @brief For removing a function from handling this event.
937 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
938 void onUserUpdate(discord_core_internal::event_delegate_token& token);
939
940 /// @brief For adding a function to handle this event.
941 /// @param handler a delegate taking an on_voice_state_update_data structure as an argument.
942 /// @return an event_token for later de-registering the event.
943 discord_core_internal::event_delegate_token onVoiceStateUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_voice_state_update_data&> handler);
944 /// @brief For removing a function from handling this event.
945 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
946 void onVoiceStateUpdate(discord_core_internal::event_delegate_token& token);
947
948 /// @brief For adding a function to handle this event.
949 /// @param handler a delegate taking an on_voice_server_update_data structure as an argument.
950 /// @return an event_token for later de-registering the event.
951 discord_core_internal::event_delegate_token onVoiceServerUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_voice_server_update_data&> handler);
952 /// @brief For removing a function from handling this event.
953 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
954 void onVoiceServerUpdate(discord_core_internal::event_delegate_token& token);
955
956 /// @brief For adding a function to handle this event.
957 /// @param handler a delegate taking an on_webhook_update_data structure as an argument.
958 /// @return an event_token for later de-registering the event.
959 discord_core_internal::event_delegate_token onWebhookUpdate(discord_core_internal::event_delegate<co_routine<void>, const on_webhook_update_data&> handler);
960 /// @brief For removing a function from handling this event.
961 /// @param token an discord_core_internal::event_delegate_token, from the original event registration.
962 void onWebhookUpdate(discord_core_internal::event_delegate_token& token);
963
964 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_gateway_ping_data&> onGatewayPingEvent{};
965
966 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_application_command_permissions_update_data&> onApplicationCommandPermissionsUpdateEvent{};
967
968 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_auto_moderation_rule_creation_data&> onAutoModerationRuleCreationEvent{};
969
970 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_auto_moderation_rule_update_data&> onAutoModerationRuleUpdateEvent{};
971
972 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_auto_moderation_rule_deletion_data&> onAutoModerationRuleDeletionEvent{};
973
974 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_auto_moderation_action_execution_data&> onAutoModerationActionExecutionEvent{};
975
976 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_auto_complete_entry_data&> onAutoCompleteEntryEvent{};
977
978 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_input_event_creation_data&> onInputEventCreationEvent{};
979
980 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_channel_creation_data&> onChannelCreationEvent{};
981
982 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_channel_update_data&> onChannelUpdateEvent{};
983
984 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_channel_deletion_data&> onChannelDeletionEvent{};
985
986 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_channel_pins_update_data&> onChannelPinsUpdateEvent{};
987
988 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_thread_creation_data&> onThreadCreationEvent{};
989
990 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_thread_update_data&> onThreadUpdateEvent{};
991
992 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_thread_deletion_data&> onThreadDeletionEvent{};
993
994 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_thread_list_sync_data&> onThreadListSyncEvent{};
995
996 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_thread_member_update_data&> onThreadMemberUpdateEvent{};
997
998 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_thread_members_update_data&> onThreadMembersUpdateEvent{};
999
1000 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_creation_data&> onGuildCreationEvent{};
1001
1002 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_update_data&> onGuildUpdateEvent{};
1003
1004 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_deletion_data&> onGuildDeletionEvent{};
1005
1006 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_ban_add_data&> onGuildBanAddEvent{};
1007
1008 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_ban_remove_data&> onGuildBanRemoveEvent{};
1009
1010 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_emojis_update_data&> onGuildEmojisUpdateEvent{};
1011
1012 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_stickers_update_data&> onGuildStickersUpdateEvent{};
1013
1014 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_integrations_update_data&> onGuildIntegrationsUpdateEvent{};
1015
1016 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_member_add_data&> onGuildMemberAddEvent{};
1017
1018 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_member_remove_data&> onGuildMemberRemoveEvent{};
1019
1020 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_member_update_data&> onGuildMemberUpdateEvent{};
1021
1022 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_members_chunk_data&> onGuildMembersChunkEvent{};
1023
1024 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_role_creation_data&> onRoleCreationEvent{};
1025
1026 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_role_update_data&> onRoleUpdateEvent{};
1027
1028 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_role_deletion_data&> onRoleDeletionEvent{};
1029
1030 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_scheduled_event_creation_data&> onGuildScheduledEventCreationEvent{};
1031
1032 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_scheduled_event_update_data&> onGuildScheduledEventUpdateEvent{};
1033
1034 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_scheduled_event_deletion_data&> onGuildScheduledEventDeletionEvent{};
1035
1036 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_scheduled_event_user_add_data&> onGuildScheduledEventUserAddEvent{};
1037
1038 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_guild_scheduled_event_user_remove_data&> onGuildScheduledEventUserRemoveEvent{};
1039
1040 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_integration_creation_data&> onIntegrationCreationEvent{};
1041
1042 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_integration_update_data&> onIntegrationUpdateEvent{};
1043
1044 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_integration_deletion_data&> onIntegrationDeletionEvent{};
1045
1046 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_interaction_creation_data&> onInteractionCreationEvent{};
1047
1048 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_invite_creation_data&> onInviteCreationEvent{};
1049
1050 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_invite_deletion_data&> onInviteDeletionEvent{};
1051
1052 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_message_creation_data&> onMessageCreationEvent{};
1053
1054 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_message_update_data&> onMessageUpdateEvent{};
1055
1056 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_message_deletion_data&> onMessageDeletionEvent{};
1057
1058 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_message_delete_bulk_data&> onMessageDeleteBulkEvent{};
1059
1060 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_reaction_add_data&> onReactionAddEvent{};
1061
1062 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_reaction_remove_data&> onReactionRemoveEvent{};
1063
1064 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_reaction_remove_all_data&> onReactionRemoveAllEvent{};
1065
1066 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_reaction_remove_emoji_data&> onReactionRemoveEmojiEvent{};
1067
1068 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_presence_update_data&> onPresenceUpdateEvent{};
1069
1070 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_stage_instance_creation_data&> onStageInstanceCreationEvent{};
1071
1072 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_stage_instance_update_data&> onStageInstanceUpdateEvent{};
1073
1074 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_stage_instance_deletion_data&> onStageInstanceDeletionEvent{};
1075
1076 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_typing_start_data&> onTypingStartEvent{};
1077
1078 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_user_update_data&> onUserUpdateEvent{};
1079
1080 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_voice_state_update_data&> onVoiceStateUpdateEvent{};
1081
1082 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_voice_server_update_data&> onVoiceServerUpdateEvent{};
1083
1084 DCA_INLINE static discord_core_internal::event<co_routine<void>, const on_webhook_update_data&> onWebhookUpdateEvent{};
1085 };
1086 /**@}*/
1087
1088}// namespace discord_core_api
Class for handling the assignment of event-handling functions.int32_t.
void onGatewayPing(discord_core_internal::event_delegate_token &token)
For removing a function from handling this event.
discord_core_internal::event_delegate_token onGatewayPing(discord_core_internal::event_delegate< co_routine< void >, const on_gateway_ping_data & > handler)
For adding a function to handle this event.
The main namespace for the forward-facing interfaces.
Data that is received as part of an application_command_permissions update event.
Data that is received upon the bot receiving an autocomplete entry.
Data that is received as part of an auto_moderation_action execution event.
Data that is received as part of an auto_moderation_rule_data creation event.
Data that is received as part of an auto_moderation_rule_data delete event.
Data that is received as part of an auto_moderation_rule_data update event.
Data that is received as part of a channel creation event.
Data that is received as part of a channel deletion event.
Data that is received as part of a channel pins update event.
Data that is received as part of a channel update event.
Data that is received as part of a gateway ping event.
int32_t timeUntilNextPing
The number of milliseconds until the next ping.
Data that is received as part of a guild ban add event.
Data that is received as part of a guild ban add event.
Data that is received as part of a guild creation event.
Data that is received as part of a guild deletion event.
Data that is received as part of a guild emojis update event.
Data that is received as part of a guild integration update event.
Data that is received as part of a guild_member add event.
Data that is received as part of a guild_member remove event.
Data that is received as part of a guild_member update event.
Data that is received as part of a guild_members chunk event.
Data that is received as part of a guild_scheduled_event_data creation event.
Data that is received as part of a guild_scheduled_event_data delete event.
Data that is received as part of a guild_scheduled_event_data update event.
Data that is received as part of a guild_scheduled_event_data user add event.
Data that is received as part of a guild_scheduled_event_data user remove event.
Data that is received as part of a guild sticker update event.
Data that is received as part of a guild update event.
Data that is received as part of an input_event creation event.
Data that is received as part of an integration creation event.
Data that is received as part of an integration deletion event.
Data that is received as part of an integration update event.
Data that is received as part of an interaction creation event.
Data that is received as part of an invite creation event.
Data that is received as part of an invite deletion event.
Data that is received as part of a message creation event.
Data that is received as part of a message delete bulk event.
Data that is received as part of a message deletion event.
Data that is received as part of a message update event.
Data that is received as part of a presence update event.
Data that is received as part of a reaction add event.
Data that is received as part of a reaction remove all event.
Data that is received as part of a reaction remove event.
Data that is received as part of a reaction remove emoji event.
Data that is received as part of a role_data creation event.
Data that is received as part of a role_data deletion event.
Data that is received as part of a role_data update event.
Data that is received as part of a stage_instance_data creation event.
Data that is received as part of a stage_instance_data deletion event.
Data that is received as part of a stage_instance_data update event.
Data that is received as part of a thread_data creation event.
Data that is received as part of a thread_data deletion event.
Data that is received as part of a thread_data list sync event.
Data that is received as part of a thread_data member update event.
Data that is received as part of a thread_data members update event.
Data that is received as part of a thread_data update event.
Data that is received as part of a typing start event.
Data that is received as part of a user update event.
Data that is received as part of a voice server update event.
Data that is received as part of a voice state update event.
Data that is received as part of a web_hook update event.