37 namespace discord_core_internal {
39 template<>
struct websocket_message_data<update_voice_state_data> {
40 websocket_message_data() =
default;
41 websocket_message_data(
const update_voice_state_data& data);
42 unordered_set<jsonifier::string> jsonifierExcludedKeys{};
43 using type = update_voice_state_data;
45 jsonifier::string t{};
48 operator etf_serializer();
51 template<>
struct websocket_message_data<update_voice_state_data_dc> {
52 websocket_message_data() =
default;
53 websocket_message_data(
const update_voice_state_data& data);
54 unordered_set<jsonifier::string> jsonifierExcludedKeys{};
55 using type = update_voice_state_data_dc;
57 jsonifier::string t{};
60 operator etf_serializer();
65namespace jsonifier_internal {
67 template<
typename value_type>
68 concept snowflake_t = std::same_as<discord_core_api::snowflake, jsonifier_internal::unwrap_t<value_type>>;
70 template<jsonifier::serialize_options options, snowflake_t value_type, jsonifier::concepts::buffer_like buffer_type,
typename serialize_context_type>
71 struct serialize_impl<options, value_type, buffer_type, serialize_context_type> {
72 template<
typename value_type_new> JSONIFIER_ALWAYS_INLINE
static void impl(value_type_new&& value, buffer_type& buffer, serialize_context_type& serializePair)
noexcept {
73 jsonifier::string newString{
static_cast<jsonifier::string
>(value) };
74 serialize<options>::impl(newString, buffer, serializePair);
78 template<
bool minified, jsonifier::parse_options options, snowflake_t value_type,
typename parse_context_type>
struct parse_impl<minified, options, value_type, parse_context_type> {
79 JSONIFIER_ALWAYS_INLINE
static void impl(value_type& value, parse_context_type& context)
noexcept {
80 jsonifier::raw_json_data newString{};
81 parse<minified, options>::impl(newString, context);
82 if (newString.getType() == jsonifier::json_type::String) {
83 value = newString.operator jsonifier::string();
85 value = newString.operator uint64_t();
90 template<
typename value_type>
91 concept time_stamp_t = std::same_as<discord_core_api::time_stamp, jsonifier_internal::unwrap_t<value_type>>;
93 template<jsonifier::serialize_options options, time_stamp_t value_type, jsonifier::concepts::buffer_like buffer_type,
typename serialize_context_type>
94 struct serialize_impl<options, value_type, buffer_type, serialize_context_type> {
95 template<
typename value_type_new> JSONIFIER_ALWAYS_INLINE
static void impl(value_type_new&& value, buffer_type& buffer, serialize_context_type& serializePair)
noexcept {
96 jsonifier::string newString{
static_cast<jsonifier::string
>(value) };
97 serialize<options>::impl(newString, buffer, serializePair);
101 template<
bool minified, jsonifier::parse_options options, time_stamp_t value_type,
typename parse_context_type>
102 struct parse_impl<minified, options, value_type, parse_context_type> {
103 JSONIFIER_ALWAYS_INLINE
static void impl(value_type& value, parse_context_type& context)
noexcept {
104 jsonifier::raw_json_data newString{};
105 parse<minified, options>::impl(newString, context);
106 if (newString.getType() == jsonifier::json_type::String) {
107 value = newString.operator jsonifier::string();
109 value = newString.operator uint64_t();
117 template<>
struct core<discord_core_api::ready_data> {
118 using value_type = discord_core_api::ready_data;
119 static constexpr auto parseValue = createValue(
"resume_gateway_url", &value_type::resumeGatewayUrl,
"shard", &value_type::shard,
"v", &value_type::v,
"session_id",
120 &value_type::sessionId,
"user", &value_type::user,
"application", &value_type::application,
"_trace", &value_type::trace);
123 template<>
struct core<discord_core_api::discord_core_internal::websocket_message> {
124 using value_type = discord_core_api::discord_core_internal::websocket_message;
125 static constexpr auto parseValue = createValue(
"op", &value_type::op,
"s", &value_type::s,
"t", &value_type::t);
128 template<
typename oty2>
struct core<discord_core_api::discord_core_internal::websocket_message_data<oty2>> {
129 using value_type = discord_core_api::discord_core_internal::websocket_message_data<oty2>;
130 static constexpr auto parseValue = createValue(
"d", &value_type::d,
"op", &value_type::op,
"s", &value_type::s);
133 template<>
struct core<discord_core_api::application_command_permission_data> {
134 using value_type = discord_core_api::application_command_permission_data;
135 static constexpr auto parseValue = createValue(
"id", &value_type::id,
"permission", &value_type::permission,
"type", &value_type::type);
138 template<>
struct core<discord_core_api::guild_application_command_permissions_data> {
139 using value_type = discord_core_api::guild_application_command_permissions_data;
140 static constexpr auto parseValue =
141 createValue(
"application_id", &value_type::applicationId,
"permissions", &value_type::permissions,
"guild_id", &value_type::guildId,
"id", &value_type::id);
144 template<>
struct core<discord_core_api::session_start_data> {
145 using value_type = discord_core_api::session_start_data;
146 static constexpr auto parseValue =
147 createValue(
"max_concurrency", &value_type::maxConcurrency,
"remaining", &value_type::remaining,
"reset_after", &value_type::resetAfter,
"total", &value_type::total);
150 template<>
struct core<discord_core_api::authorization_info_data> {
151 using value_type = discord_core_api::authorization_info_data;
152 static constexpr auto parseValue =
153 createValue(
"application", &value_type::application,
"expires", &value_type::expires,
"scopes", &value_type::scopes,
"user", &value_type::user);
156 template<>
struct core<discord_core_api::trigger_meta_data> {
157 using value_type = discord_core_api::trigger_meta_data;
158 static constexpr auto parseValue = createValue(
"allow_list", &value_type::allowList,
"keyword_filter", &value_type::keywordFilter,
"mention_total_limit",
159 &value_type::mentionTotalLimit,
"presets", &value_type::presets);
162 template<>
struct core<discord_core_api::partial_emoji_data> {
163 using value_type = discord_core_api::partial_emoji_data;
164 static constexpr auto parseValue = createValue(
"id", &value_type::id,
"name", &value_type::name,
"animated", &value_type::animated);
167 template<>
struct core<discord_core_api::emoji_data> {
168 using value_type = discord_core_api::emoji_data;
169 static constexpr auto parseValue = createValue(
"id", &value_type::id,
"name", &value_type::name,
"roles", &value_type::roles,
"require_colons", &value_type::requireColons,
170 "managed", &value_type::managed,
"animated", &value_type::animated,
"available", &value_type::available);
173 template<>
struct core<discord_core_api::team_members_object_data> {
174 using value_type = discord_core_api::team_members_object_data;
175 static constexpr auto parseValue =
176 createValue(
"membership_state", &value_type::membershipState,
"permissions", &value_type::permissions,
"team_id", &value_type::teamId,
"user", &value_type::user);
179 template<>
struct core<discord_core_api::team_object_data> {
180 using value_type = discord_core_api::team_object_data;
181 static constexpr auto parseValue =
182 createValue(
"icon", &value_type::icon,
"id", &value_type::id,
"members", &value_type::members,
"owner_user_id", &value_type::ownerUserId);
185 template<>
struct core<discord_core_api::install_params_data> {
186 using value_type = discord_core_api::install_params_data;
187 static constexpr auto parseValue = createValue(
"scopes", &value_type::scopes,
"permissions", &value_type::permissions);
190 template<>
struct core<discord_core_api::application_data> {
191 using value_type = discord_core_api::application_data;
192 static constexpr auto parseValue =
193 createValue(
"bot_public", &value_type::botPublic,
"bot_require_code_grant", &value_type::botRequireCodeGrant,
"cover_image", &value_type::coverImage,
194 "custom_install_url", &value_type::customInstallUrl,
"description", &value_type::description,
"flags", &value_type::flags,
"guild_id", &value_type::guildId,
"icon",
195 &value_type::icon,
"name", &value_type::name,
"owner", &value_type::owner,
"params", &value_type::params,
"primary_sku_id", &value_type::primarySkuId,
196 "privacy_policy_url", &value_type::privacyPolicyUrl,
"rpc_origins", &value_type::rpcOrigins,
"slug", &value_type::slug,
"summary", &value_type::summary,
"tags",
197 &value_type::tags,
"team", &value_type::team,
"terms_of_service_url", &value_type::termsOfServiceUrl,
"verify_key", &value_type::verifyKey);
200 template<>
struct core<discord_core_api::thread_metadata_data> {
201 using value_type = discord_core_api::thread_metadata_data;
202 static constexpr auto parseValue = createValue(
"archived", &value_type::archived,
"archived_timestamp", &value_type::archiveTimestamp,
"auto_archive_duration",
203 &value_type::autoArchiveDuration,
"invitable", &value_type::invitable,
"locked", &value_type::locked);
206 template<>
struct core<discord_core_api::gateway_bot_data> {
207 using value_type = discord_core_api::gateway_bot_data;
208 static constexpr auto parseValue = createValue(
"session_start_limit", &value_type::sessionStartLimit,
"shards", &value_type::shards,
"url", &value_type::url);
211 template<>
struct core<discord_core_api::user_id_base> {
212 using value_type = discord_core_api::user_id_base;
213 static constexpr auto parseValue = createValue(
"id", &value_type::id);
216 template<>
struct core<discord_core_api::
user_data> {
218 static constexpr auto parseValue = createValue(
"id", &value_type::id,
"username", &value_type::userName,
"discriminator", &value_type::discriminator,
"global_name",
219 &value_type::globalName,
"avatar", &value_type::avatar,
"bot", &value_type::bot,
"system", &value_type::system,
"mfa_enabled", &value_type::mfaEnabled,
"banner",
220 &value_type::banner,
"accentColor", &value_type::accentColor,
"locale", &value_type::locale,
"verified", &value_type::verified,
"email", &value_type::email,
"flags",
221 &value_type::flags,
"premium_type", &value_type::premiumType,
"public_flags", &value_type::publicFlags,
"avatar_decoration", &value_type::avatarDecoration);
224 template<>
struct core<discord_core_api::welcome_screen_channel_data> {
225 using value_type = discord_core_api::welcome_screen_channel_data;
226 static constexpr auto parseValue =
227 createValue(
"channel_id", &value_type::channelId,
"description", &value_type::description,
"emoji_id", &value_type::emojiId,
"emoji_name", &value_type::emojiName);
230 template<>
struct core<discord_core_api::welcome_screen_data> {
231 using value_type = discord_core_api::welcome_screen_data;
232 static constexpr auto parseValue = createValue(
"description", &value_type::description,
"welcome_screen_channels", &value_type::welcomeChannels);
235 template<>
struct core<discord_core_api::action_meta_data> {
236 using value_type = discord_core_api::action_meta_data;
237 static constexpr auto parseValue = createValue(
"channel_id", &value_type::channelId,
"duration_seconds", &value_type::durationSeconds);
240 template<>
struct core<discord_core_api::action_data> {
241 using value_type = discord_core_api::action_data;
242 static constexpr auto parseValue = createValue(
"meta_data", &value_type::metadata,
"type", &value_type::type);
245 template<>
struct core<discord_core_api::guild_preview_data> {
246 using value_type = discord_core_api::guild_preview_data;
247 static constexpr auto parseValue =
248 createValue(
"approximate_member_count", &value_type::approximateMemberCount,
"approximate_presence_count", &value_type::approximatePresenceCount,
"description",
249 &value_type::description,
"discovery_splash", &value_type::discoverySplash,
"emojis", &value_type::emojis,
"features", &value_type::features,
"icon",
250 &value_type::icon,
"id", &value_type::id,
"name", &value_type::name,
"splash", &value_type::splash,
"stickers", &value_type::stickers);
253 template<>
struct core<discord_core_api::thread_member_data> {
254 using value_type = discord_core_api::thread_member_data;
255 static constexpr auto parseValue = createValue(
"flags", &value_type::flags,
"join_timestamp", &value_type::joinTimestamp,
"user_id", &value_type::userId);
258 template<>
struct core<discord_core_api::audit_log_data> {
259 using value_type = discord_core_api::audit_log_data;
260 static constexpr auto parseValue = createValue(
"audit_log_entries", &value_type::auditLogEntries,
"auto_moderation_rules", &value_type::autoModerationRules,
261 "guild_scheduled_events", &value_type::guildScheduledEvents,
"integrations", &value_type::integrations,
"threads", &value_type::threads,
"users", &value_type::users,
262 "webhooks", &value_type::webhooks);
265 template<>
struct core<discord_core_api::ban_data> {
266 using value_type = discord_core_api::ban_data;
267 static constexpr auto parseValue = createValue(
"failed_due_to_perms", &value_type::failedDueToPerms,
"user", &value_type::user);
270 template<>
struct core<discord_core_api::update_voice_state_data> {
271 using value_type = discord_core_api::update_voice_state_data;
272 static constexpr auto parseValue =
273 createValue(
"channel_id", &value_type::channelId,
"guild_id", &value_type::guildId,
"self_deaf", &value_type::selfDeaf,
"self_mute", &value_type::selfMute);
276 template<>
struct core<discord_core_api::update_voice_state_data_dc> {
277 using value_type = discord_core_api::update_voice_state_data_dc;
278 static constexpr auto parseValue =
279 createValue(
"channel_id", &value_type::channelId,
"guild_id", &value_type::guildId,
"self_deaf", &value_type::selfDeaf,
"self_mute", &value_type::selfMute);
282 template<>
struct core<discord_core_api::guild_widget_data> {
283 using value_type = discord_core_api::guild_widget_data;
284 static constexpr auto parseValue = createValue(
"channel_id", &value_type::channelId,
"enabled", &value_type::enabled);
287 template<>
struct core<discord_core_api::channel_data> {
288 using value_type = discord_core_api::channel_data;
289 static constexpr auto parseValue = createValue(
"permission_overwrites", &value_type::permissionOverwrites,
"default_reaction_emoji", &value_type::defaultReactionEmoji,
290 "available_tags", &value_type::availableTags,
"default_thread_rate_limit_per_user", &value_type::defaultThreadRateLimitPerUser,
"applied_tags",
291 &value_type::appliedTags,
"default_forum_layout", &value_type::defaultForumLayout,
"default_auto_archive_duration", &value_type::defaultAutoArchiveDuration,
292 "thread_metadata", &value_type::threadMetadata,
"recipients", &value_type::recipients,
"default_sort_order", &value_type::defaultSortOrder,
"last_pin_timestamp",
293 &value_type::lastPinTimestamp,
"last_message_id", &value_type::lastMessageId,
"application_id", &value_type::applicationId,
"total_message_sent",
294 &value_type::totalMessageSent,
"rate_limit_per_user", &value_type::rateLimitPerUser,
"video_quality_mode", &value_type::videoQualityMode,
"member", &value_type::member,
295 "permissions", &value_type::permissions,
"rtc_region", &value_type::rtcRegion,
"message_count", &value_type::messageCount,
"owner_id", &value_type::ownerId,
296 "member_count", &value_type::memberCount,
"flags", &value_type::flags,
"topic", &value_type::topic,
"user_limit", &value_type::userLimit,
"parent_id",
297 &value_type::parentId,
"type", &value_type::type,
"guild_id", &value_type::guildId,
"position", &value_type::position,
"name", &value_type::name,
"icon",
298 &value_type::icon,
"bitrate", &value_type::bitrate,
"id", &value_type::id,
"managed", &value_type::managed,
"nsfw", &value_type::nsfw);
301 template<>
struct core<discord_core_api::guild_member_data> {
302 using value_type = discord_core_api::guild_member_data;
303 static constexpr auto parseValue =
304 createValue(
"user", &value_type::user,
"nick", &value_type::nick,
"avatar", &value_type::avatar,
"roles", &value_type::roles,
"joined_at", &value_type::joinedAt,
305 "premium_since", &value_type::premiumSince,
"deaf", &value_type::deaf,
"mute", &value_type::mute,
"flags", &value_type::flags,
"pending", &value_type::pending,
306 "permissions", &value_type::permissions,
"communication_disabled_until", &value_type::communicationDisabledUntil,
"guild_id", &value_type::guildId);
309 template<>
struct core<discord_core_api::thread_list_sync_data> {
310 using value_type = discord_core_api::thread_list_sync_data;
311 static constexpr auto parseValue =
312 createValue(
"members", &value_type::members,
"channel_ids", &value_type::channelIds,
"threads", &value_type::threads,
"guild_id", &value_type::guildId);
315 template<>
struct core<discord_core_api::interaction_data_data> {
316 using value_type = discord_core_api::interaction_data_data;
317 static constexpr auto parseValue = createValue(
"options", &value_type::options,
"values", &value_type::values,
"components", &value_type::components,
"type",
318 &value_type::type,
"component_type", &value_type::componentType,
"custom_id", &value_type::customId,
"name", &value_type::name,
"resolved", &value_type::resolved,
319 "target_id", &value_type::targetId,
"guild_id", &value_type::guildId,
"id", &value_type::id);
322 template<>
struct core<discord_core_api::resolved_data> {
323 using value_type = discord_core_api::resolved_data;
324 static constexpr auto parseValue = createValue(
"attachments", &value_type::attachments,
"members", &value_type::members,
"messages", &value_type::messages,
"channels",
325 &value_type::channels,
"users", &value_type::users,
"roles", &value_type::roles);
328 template<>
struct core<discord_core_api::application_command_interaction_data_option> {
329 using value_type = discord_core_api::application_command_interaction_data_option;
330 static constexpr auto parseValue =
331 createValue(
"name", &value_type::name,
"type", &value_type::type,
"value", &value_type::value,
"focused", &value_type::focused,
"options", &value_type::options);
334 template<>
struct core<discord_core_api::interaction_data> {
335 using value_type = discord_core_api::interaction_data;
336 static constexpr auto parseValue = createValue(
"app_permissions", &value_type::appPermissions,
"guild_locale", &value_type::guildLocale,
"data", &value_type::data,
337 "locale", &value_type::locale,
"member", &value_type::member,
"application_id", &value_type::applicationId,
"token", &value_type::token,
"message",
338 &value_type::message,
"channel", &value_type::channel,
"channel_id", &value_type::channelId,
"guild_id", &value_type::guildId,
"guild", &value_type::guild,
"version",
339 &value_type::version,
"user", &value_type::user,
"id", &value_type::id,
"type", &value_type::type);
342 template<>
struct core<discord_core_api::input_event_data> {
343 using value_type = discord_core_api::input_event_data;
344 static constexpr auto parseValue = createValue(
"response_type", &value_type::responseType,
"interaction_data", &value_type::interactionData);
347 template<>
struct core<discord_core_api::thread_members_update_data> {
348 using value_type = discord_core_api::thread_members_update_data;
349 static constexpr auto parseValue = createValue(
"added_members", &value_type::addedMembers,
"member_count", &value_type::memberCount,
"guild_id", &value_type::guildId,
350 "removed_member_ids", &value_type::removedMemberIds);
353 template<>
struct core<discord_core_api::web_hook_data> {
354 using value_type = discord_core_api::web_hook_data;
355 static constexpr auto parseValue = createValue(
"application_id", &value_type::applicationId,
"avatar", &value_type::avatar,
"channel_id", &value_type::channelId,
356 "guild_id", &value_type::guildId,
"id", &value_type::id,
"name", &value_type::name,
"source_channel", &value_type::sourceChannel,
"source_guild",
357 &value_type::sourceGuild,
"token", &value_type::token,
"type", &value_type::type,
"url", &value_type::url,
"user", &value_type::user);
360 template<>
struct core<discord_core_api::audit_log_change_data> {
361 using value_type = discord_core_api::audit_log_change_data;
362 static constexpr auto parseValue = createValue(
"key", &value_type::key,
"new_value", &value_type::newValue,
"old_value", &value_type::oldValue);
365 template<>
struct core<discord_core_api::optional_audit_entry_info_data> {
366 using value_type = discord_core_api::optional_audit_entry_info_data;
367 static constexpr auto parseValue = createValue(
"delete_member_days", &value_type::deleteMemberDays,
"members_removed", &value_type::membersRemoved,
"application_id",
368 &value_type::applicationId,
"role_name", &value_type::roleName,
"channel_id", &value_type::channelId,
"message_id", &value_type::messageId,
"count", &value_type::count,
369 "type", &value_type::type);
372 template<>
struct core<discord_core_api::archived_threads_data> {
373 using value_type = discord_core_api::archived_threads_data;
374 static constexpr auto parseValue = createValue(
"has_more", &value_type::hasMore,
"member", &value_type::members,
"threads", &value_type::threads);
377 template<>
struct core<discord_core_api::connection_data> {
378 using value_type = discord_core_api::connection_data;
379 static constexpr auto parseValue = createValue(
"friend_sync", &value_type::friendSync,
"id", &value_type::id,
"integrations", &value_type::integrations,
"name",
380 &value_type::name,
"revoked", &value_type::revoked,
"show_activity", &value_type::showActivity,
"type", &value_type::type,
"verified", &value_type::verified,
381 "visibility", &value_type::visibility);
384 template<>
struct core<discord_core_api::guild_prune_count_data> {
385 using value_type = discord_core_api::guild_prune_count_data;
386 static constexpr auto parseValue = createValue(
"count", &value_type::count);
389 template<>
struct core<discord_core_api::thread_data> {
390 using value_type = discord_core_api::thread_data;
391 static constexpr auto parseValue = createValue(
"application_id", &value_type::applicationId,
"applied_tags", &value_type::appliedTags,
"available_tags",
392 &value_type::availableTags,
"guild_id", &value_type::guildId,
"bitrate", &value_type::bitrate,
"default_auto_archive_duration", &value_type::defaultAutoArchiveDuration,
393 "default_reaction_emoji", &value_type::defaultReactionEmoji,
"flags", &value_type::flags,
"icon", &value_type::icon,
"id", &value_type::id,
"last_message_id",
394 &value_type::lastMessageId,
"last_pin_timestamp", &value_type::lastPinTimestamp,
"member", &value_type::member,
"member_count", &value_type::memberCount,
395 "message_count", &value_type::messageCount,
"name", &value_type::name,
"owner_id", &value_type::ownerId,
"parent_id", &value_type::parentId,
"permission_overwrites",
396 &value_type::permissionOverwrites,
"permissions", &value_type::permissions,
"position", &value_type::position,
"rate_limit_per_user", &value_type::rateLimitPerUser,
397 "recipients", &value_type::recipients,
"rtc_region", &value_type::rtcRegion,
"thread_metadata", &value_type::threadMetadata,
"topic", &value_type::topic,
398 "total_message_sent", &value_type::totalMessageSent,
"type", &value_type::type,
"user_limit", &value_type::userLimit,
"video_quality_mode",
399 &value_type::videoQualityMode);
402 template<>
struct core<discord_core_api::over_write_data> {
403 using value_type = discord_core_api::over_write_data;
404 static constexpr auto parseValue = createValue(
"allow", &value_type::allow,
"deny", &value_type::deny,
"id", &value_type::id,
"type", &value_type::type);
407 template<>
struct core<discord_core_api::forum_tag_data> {
408 using value_type = discord_core_api::forum_tag_data;
409 static constexpr auto parseValue = createValue(
"emoji_id", &value_type::emojiId,
"emoji_name", &value_type::emojiName,
"id", &value_type::id,
"moderated",
410 &value_type::moderated,
"name", &value_type::name);
413 template<>
struct core<discord_core_api::default_reaction_data> {
414 using value_type = discord_core_api::default_reaction_data;
415 static constexpr auto parseValue = createValue(
"emoji_id", &value_type::emojiId,
"emoji_name", &value_type::emojiName);
418 template<>
struct core<discord_core_api::voice_region_data> {
419 using value_type = discord_core_api::voice_region_data;
420 static constexpr auto parseValue =
421 createValue(
"custom", &value_type::custom,
"depracated", &value_type::deprecated,
"id", &value_type::id,
"name", &value_type::name,
"optimal", &value_type::optimal);
424 template<>
struct core<discord_core_api::invite_data> {
425 using value_type = discord_core_api::invite_data;
426 static constexpr auto parseValue =
427 createValue(
"approximate_member_count", &value_type::approximateMemberCount,
"approximate_presence_count", &value_type::approximatePresenceCount,
"channel",
428 &value_type::channel,
"guild_id", &value_type::guildId,
"code", &value_type::code,
"created_at", &value_type::createdAt,
"expires_at", &value_type::expiresAt,
429 "guild", &value_type::guild,
"guild_scheduled_event", &value_type::guildScheduledEvent,
"inviter", &value_type::inviter,
"max_age", &value_type::maxAge,
"max_uses",
430 &value_type::maxUses,
"stage_instance", &value_type::stageInstance,
"target_application", &value_type::targetApplication,
"target_type", &value_type::targetType,
431 "target_user", &value_type::targetUser,
"temporary", &value_type::temporary,
"uses", &value_type::uses);
434 template<>
struct core<discord_core_api::auto_moderation_rule_data> {
435 using value_type = discord_core_api::auto_moderation_rule_data;
436 static constexpr auto parseValue = createValue(
"actions", &value_type::actions,
"creator_id", &value_type::creatorId,
"enabled", &value_type::enabled,
"guild_id",
437 &value_type::guildId,
"event_type", &value_type::eventType,
"exempt_channels", &value_type::exemptChannels,
"exempt_roles", &value_type::exemptRoles,
"id",
438 &value_type::id,
"trigger_meta_data", &value_type::triggerMetaData,
"trigger_type", &value_type::triggerType);
441 template<>
struct core<discord_core_api::application_command_data> {
442 using value_type = discord_core_api::application_command_data;
443 static constexpr auto parseValue = createValue(
"application_id", &value_type::applicationId,
"default_member_permissions", &value_type::defaultMemberPermissions,
444 "description", &value_type::description,
"guild_id", &value_type::guildId,
"description_localizations", &value_type::descriptionLocalizations,
"dm_permission",
445 &value_type::dmPermission,
"id", &value_type::id,
"name", &value_type::name,
"name_localizations", &value_type::nameLocalizations,
"options", &value_type::options,
446 "type", &value_type::type,
"version", &value_type::version);
449 template<>
struct core<discord_core_api::sticker_data> {
450 using value_type = discord_core_api::sticker_data;
451 static constexpr auto parseValue = createValue(
"asset", &value_type::asset,
"description", &value_type::description,
"format_type", &value_type::formatType,
"id",
452 &value_type::id,
"name", &value_type::name,
"pack_id", &value_type::packId,
"tags", &value_type::tags,
"type", &value_type::type,
"user", &value_type::user,
"guild_id",
453 &value_type::guildId,
"sort_value", &value_type::sortValue,
"nsfw_level", &value_type::nsfwLevel,
"flags", &value_type::flags);
456 template<>
struct core<discord_core_api::message_activity_data> {
457 using value_type = discord_core_api::message_activity_data;
458 static constexpr auto parseValue = createValue(
"type", &value_type::type,
"party_id", &value_type::partyId);
461 template<>
struct core<discord_core_api::active_threads_data> {
462 using value_type = discord_core_api::active_threads_data;
463 static constexpr auto parseValue = createValue(
"has_more", &value_type::hasMore,
"members", &value_type::members,
"threads", &value_type::threads);
466 template<>
struct core<discord_core_api::client_status> {
467 using value_type = discord_core_api::client_status;
468 static constexpr auto parseValue = createValue(
"web", &value_type::web,
"mobile", &value_type::mobile,
"desktop", &value_type::desktop);
471 template<>
struct core<discord_core_api::activity_data> {
472 using value_type = discord_core_api::activity_data;
473 static constexpr auto parseValue = createValue(
"name", &value_type::name,
"type", &value_type::type,
"url", &value_type::url,
"state", &value_type::state,
"created_at",
474 &value_type::createdAt,
"details", &value_type::details,
"application_id", &value_type::applicationId);
477 template<>
struct core<discord_core_api::presence_update_data> {
478 using value_type = discord_core_api::presence_update_data;
479 static constexpr auto parseValue = createValue(
"client_status", &value_type::clientStatus,
"guild_id", &value_type::guildId,
"status", &value_type::status,
"user",
480 &value_type::user,
"activities", &value_type::activities);
483 template<>
struct core<discord_core_api::account_data> {
484 using value_type = discord_core_api::account_data;
485 static constexpr auto parseValue = createValue(
"name", &value_type::name);
488 template<>
struct core<discord_core_api::embed_data> {
489 using value_type = discord_core_api::embed_data;
490 static constexpr auto parseValue = createValue(
"author", &value_type::author,
"color", &value_type::hexColorValue,
"description", &value_type::description,
"fields",
491 &value_type::fields,
"footer", &value_type::footer,
"image", &value_type::image,
"provider", &value_type::provider,
"thumbnail", &value_type::thumbnail,
"timestamp",
492 &value_type::timeStamp,
"title", &value_type::title,
"type", &value_type::type,
"url", &value_type::url,
"video", &value_type::video);
495 template<>
struct core<discord_core_api::reaction_data> {
496 using value_type = discord_core_api::reaction_data;
497 static constexpr auto parseValue =
498 createValue(
"channel_id", &value_type::channelId,
"count", &value_type::count,
"emoji", &value_type::emoji,
"guild_id", &value_type::guildId,
"id", &value_type::id,
499 "member", &value_type::member,
"me", &value_type::me,
"message_id", &value_type::messageId,
"user_id", &value_type::userId);
502 template<>
struct core<discord_core_api::sticker_item_data> {
503 using value_type = discord_core_api::sticker_item_data;
504 static constexpr auto parseValue = createValue(
"format_type", &value_type::formatType,
"name", &value_type::name);
507 template<>
struct core<discord_core_api::attachment_data> {
508 using value_type = discord_core_api::attachment_data;
509 static constexpr auto parseValue = createValue(
"content_type", &value_type::contentType,
"description", &value_type::description,
"filename", &value_type::filename,
510 "height", &value_type::height,
"id", &value_type::id,
"proxy_url", &value_type::proxyUrl,
"size", &value_type::size,
"url", &value_type::url,
"width",
511 &value_type::width,
"ephemeral", &value_type::ephemeral);
514 template<>
struct core<discord_core_api::channel_mention_data> {
515 using value_type = discord_core_api::channel_mention_data;
516 static constexpr auto parseValue = createValue(
"id", &value_type::id,
"guild_id", &value_type::guildId,
"name", &value_type::name,
"type", &value_type::type);
519 template<>
struct core<discord_core_api::select_default_value_data> {
520 using value_type = discord_core_api::select_default_value_data;
521 static constexpr auto parseValue = createValue(
"id", &value_type::id,
"type", &value_type::type);
524 template<>
struct core<discord_core_api::action_row_data> {
525 using value_type = discord_core_api::action_row_data;
526 static constexpr auto parseValue = createValue(
"components", &value_type::components,
"type", &value_type::type);
529 template<>
struct core<discord_core_api::embed_footer_data> {
530 using value_type = discord_core_api::embed_footer_data;
531 static constexpr auto parseValue = createValue(
"proxy_icon_url", &value_type::proxyIconUrl,
"icon_url", &value_type::iconUrl,
"text", &value_type::text);
534 template<>
struct core<discord_core_api::embed_image_data> {
535 using value_type = discord_core_api::embed_image_data;
536 static constexpr auto parseValue = createValue(
"proxy_url", &value_type::proxyUrl,
"url", &value_type::url,
"height", &value_type::height,
"width", &value_type::width);
539 template<>
struct core<discord_core_api::embed_thumbnail_data> {
540 using value_type = discord_core_api::embed_thumbnail_data;
541 static constexpr auto parseValue = createValue(
"proxy_url", &value_type::proxyUrl,
"url", &value_type::url,
"height", &value_type::height,
"width", &value_type::width);
544 template<>
struct core<discord_core_api::embed_video_data> {
545 using value_type = discord_core_api::embed_video_data;
546 static constexpr auto parseValue = createValue(
"proxy_url", &value_type::proxyUrl,
"url", &value_type::url,
"height", &value_type::height,
"width", &value_type::width);
549 template<>
struct core<discord_core_api::embed_provider_data> {
550 using value_type = discord_core_api::embed_provider_data;
551 static constexpr auto parseValue = createValue(
"name", &value_type::name,
"url", &value_type::url);
554 template<>
struct core<discord_core_api::embed_author_data> {
555 using value_type = discord_core_api::embed_author_data;
556 static constexpr auto parseValue =
557 createValue(
"proxy_icon_url", &value_type::proxyIconUrl,
"icon_url", &value_type::iconUrl,
"name", &value_type::name,
"url", &value_type::url);
560 template<>
struct core<discord_core_api::embed_field_data> {
561 using value_type = discord_core_api::embed_field_data;
562 static constexpr auto parseValue = createValue(
"name", &value_type::name,
"value", &value_type::value,
"inline", &value_type::Inline);
565 template<>
struct core<discord_core_api::guild_member_cache_data> {
566 using value_type = discord_core_api::guild_member_cache_data;
567 static constexpr auto parseValue = createValue(
"avatar", &value_type::avatar,
"flags", &value_type::flags,
"guild_id", &value_type::guildId,
"joined_at",
568 &value_type::joinedAt,
"nick", &value_type::nick,
"permissions", &value_type::permissionsVal,
"roles", &value_type::roles,
"user", &value_type::user);
571 template<>
struct core<discord_core_api::audit_log_entry_data> {
572 using value_type = discord_core_api::audit_log_entry_data;
573 static constexpr auto parseValue = createValue(
"action_type", &value_type::actionType,
"changes", &value_type::changes,
"created_at", &value_type::createdTimeStamp,
"id",
574 &value_type::id,
"options", &value_type::options,
"target_id", &value_type::targetId,
"user_id", &value_type::userId);
577 template<>
struct core<discord_core_api::component_data> {
578 using value_type = discord_core_api::component_data;
579 static constexpr auto parseValue = createValue(
"type", &value_type::type,
"custom_id", &value_type::customId,
"options", &value_type::options,
"channel_types",
580 &value_type::channelTypes,
"placeholder", &value_type::placeholder,
"min_values", &value_type::minValues,
"max_values", &value_type::maxValues,
"min_length",
581 &value_type::minLength,
"max_length", &value_type::maxLength,
"label", &value_type::label,
"value", &value_type::value,
"title", &value_type::title,
"emoji",
582 &value_type::emoji,
"url", &value_type::url,
"required", &value_type::required,
"disabled", &value_type::disabled,
"style", &value_type::style);
585 template<>
struct core<discord_core_api::select_option_data> {
586 using value_type = discord_core_api::select_option_data;
587 static constexpr auto parseValue = createValue(
"description", &value_type::description,
"label", &value_type::label,
"value", &value_type::value,
"emoji",
588 &value_type::emoji,
"default", &value_type::_default);
591 template<>
struct core<discord_core_api::voice_state_data_light> {
592 using value_type = discord_core_api::voice_state_data_light;
593 static constexpr auto parseValue = createValue(
"channel_id", &value_type::channelId,
"guild_id", &value_type::guildId,
"user_id", &value_type::userId);
596 template<>
struct core<discord_core_api::guild_data> {
597 using value_type = discord_core_api::guild_data;
598 static constexpr auto parseValue = createValue(
"default_message_notifications", &value_type::defaultMessageNotifications,
"guild_scheduled_events",
599 &value_type::guildScheduledEvents,
"explicit_content_filter", &value_type::explicitContentFilter,
"stage_instances", &value_type::stageInstances,
"presences",
600 &value_type::presences,
"system_channel_flags", &value_type::systemChannelFlags,
"widget_enabled", &value_type::widgetEnabled,
"unavailable", &value_type::unavailable,
601 "owner", &value_type::owner,
"large", &value_type::large,
"member_count", &value_type::memberCount,
"verification_level", &value_type::verificationLevel,
"id",
602 &value_type::id,
"channels", &value_type::channels,
"roles", &value_type::roles,
"members", &value_type::members,
"voice_states", &value_type::voiceStates,
"owner_id",
603 &value_type::ownerId,
"permissions", &value_type::permissions,
"afk_channel_id", &value_type::afkChannelId,
"features", &value_type::features,
"stickers",
604 &value_type::stickers,
"max_stage_video_channel_users", &value_type::maxStageVideoChannelUsers,
"public_updates_channel_id", &value_type::publicUpdatesChannelId,
605 "premium_subscription_count", &value_type::premiumSubscriptionCount,
"approximate_presence_count", &value_type::approximatePresenceCount,
"threads",
606 &value_type::threads,
"welcome_screen", &value_type::welcomeScreen,
"safety_alerts_channel_id", &value_type::safetyAlertsChannelId,
"approximate_member_count",
607 &value_type::approximateMemberCount,
"premium_progress_bar_enabled", &value_type::premiumProgressBarEnabled,
"max_video_channel_users",
608 &value_type::maxVideoChannelUsers,
"emoji", &value_type::emoji,
"preferred_locale", &value_type::preferredLocale,
"vanity_url_code", &value_type::vanityUrlCode,
609 "system_channel_id", &value_type::systemChannelId,
"discovery_splash", &value_type::discoverySplash,
"widget_channel_id", &value_type::widgetChannelId,
610 "rules_channel_id", &value_type::rulesChannelId,
"nsfw_level", &value_type::nsfwLevel,
"application_id", &value_type::applicationId,
"description",
611 &value_type::description,
"premium_tier", &value_type::premiumTier,
"afk_timeout", &value_type::afkTimeout,
"max_members", &value_type::maxMembers,
"mfa_level",
612 &value_type::mfaLevel,
"splash", &value_type::splash,
"name", &value_type::name,
"banner", &value_type::banner,
"icon", &value_type::icon);
615 template<>
struct core<discord_core_api::partial_guild_data> {
616 using value_type = discord_core_api::partial_guild_data;
617 static constexpr auto parseValue = createValue(
"unavailable", &value_type::unavailable,
"id", &value_type::id);
620 template<>
struct core<discord_core_api::integration_data> {
621 using value_type = discord_core_api::integration_data;
622 static constexpr auto parseValue = createValue(
"account", &value_type::account,
"application", &value_type::application,
"enabled", &value_type::enabled,
623 "enable_emoticons", &value_type::enableEmoticons,
"expire_behavior", &value_type::expireBehavior,
"expire_grace_period", &value_type::expireGracePeriod,
"id",
624 &value_type::id,
"name", &value_type::name,
"revoked", &value_type::revoked,
"role_id", &value_type::roleId,
"subscriber_count", &value_type::subscriberCount,
625 "syncing", &value_type::syncing,
"synced_at", &value_type::syncedAt,
"type", &value_type::type,
"user", &value_type::user);
628 template<>
struct core<discord_core_api::file> {
629 using value_type = discord_core_api::file;
630 static constexpr auto parseValue = createValue(&value_type::data);
633 template<>
struct core<discord_core_api::allowed_mentions_data> {
634 using value_type = discord_core_api::allowed_mentions_data;
635 static constexpr auto parseValue =
636 createValue(
"replied_user", &value_type::repliedUser,
"parse", &value_type::parse,
"roles", &value_type::roles,
"users", &value_type::users);
639 template<>
struct core<discord_core_api::message_reference_data> {
640 using value_type = discord_core_api::message_reference_data;
641 static constexpr auto parseValue = createValue(
"fail_if_not_exists", &value_type::failIfNotExists,
"message_id", &value_type::messageId,
"channel_id",
642 &value_type::channelId,
"guild_id", &value_type::guildId);
645 template<>
struct core<discord_core_api::message_interaction_data> {
646 using value_type = discord_core_api::message_interaction_data;
647 static constexpr auto parseValue =
648 createValue(
"id", &value_type::id,
"member", &value_type::member,
"name", &value_type::name,
"type", &value_type::type,
"user", &value_type::user);
651 template<>
struct core<discord_core_api::guild_scheduled_event_data> {
652 using value_type = discord_core_api::guild_scheduled_event_data;
653 static constexpr auto parseValue = createValue(
"id", &value_type::id,
"privacy_level", &value_type::privacyLevel,
"entity_metadata", &value_type::entityMetadata,
654 "entity_type", &value_type::entityType,
"status", &value_type::status,
"scheduled_start_time", &value_type::scheduledStartTime,
"scheduled_end_time",
655 &value_type::scheduledEndTime,
"description", &value_type::description,
"creator_id", &value_type::creatorId,
"channel_id", &value_type::channelId,
"entity_id",
656 &value_type::entityId,
"user_count", &value_type::userCount,
"guild_id", &value_type::guildId,
"creator", &value_type::creator,
"name", &value_type::name);
659 template<>
struct core<discord_core_api::guild_scheduled_event_user_data> {
660 using value_type = discord_core_api::guild_scheduled_event_user_data;
661 static constexpr auto parseValue = createValue(
"guild_scheduled_event_id", &value_type::guildScheduledEventId,
"member", &value_type::member,
"user", &value_type::user);
664 template<>
struct core<discord_core_api::guild_scheduled_event_metadata> {
665 using value_type = discord_core_api::guild_scheduled_event_metadata;
666 static constexpr auto parseValue = createValue(
"location", &value_type::location);
669 template<>
struct core<discord_core_api::
role_data> {
671 static constexpr auto parseValue = createValue(
"id", &value_type::id,
"name", &value_type::name,
"color", &value_type::color,
"hoist", &value_type::hoist,
"icon",
672 &value_type::icon,
"unicode_emoji", &value_type::unicodeEmoji,
"position", &value_type::position,
"permissions", &value_type::permissions,
"managed",
673 &value_type::managed,
"mentionable", &value_type::mentionable,
"tags", &value_type::tags,
"flags", &value_type::flags);
676 template<>
struct core<discord_core_api::message_data> {
677 using value_type = discord_core_api::message_data;
678 static constexpr auto parseValue = createValue(
"activity", &value_type::activity,
"application", &value_type::application,
"application_id", &value_type::applicationId,
679 "attachments", &value_type::attachments,
"author", &value_type::author,
"channel_id", &value_type::channelId,
"components", &value_type::components,
"content",
680 &value_type::content,
"edited_timestamp", &value_type::editedTimestamp,
"embeds", &value_type::embeds,
"flags", &value_type::flags,
"guild_id", &value_type::guildId,
681 "id", &value_type::id,
"interaction", &value_type::interaction,
"member", &value_type::member,
"mention_channels", &value_type::mentionChannels,
"mention_everyone",
682 &value_type::mentionEveryone,
"mention_roles", &value_type::mentionRoles,
"mentions", &value_type::mentions,
"message_reference", &value_type::messageReference,
683 "nonce", &value_type::nonce,
"pinned", &value_type::pinned,
"reactions", &value_type::reactions,
"sticker_items", &value_type::stickerItems,
"stickers",
684 &value_type::stickers,
"thread", &value_type::thread,
"timestamp", &value_type::timeStamp,
"tts", &value_type::tts,
"type", &value_type::type,
"webhook_id",
685 &value_type::webHookId);
688 template<>
struct core<discord_core_api::sticker_pack_data> {
689 using value_type = discord_core_api::sticker_pack_data;
690 static constexpr auto parseValue = createValue(
"banner_asset_id", &value_type::bannerAssetId,
"cover_sticker_id", &value_type::coverStickerId,
"description",
691 &value_type::description,
"id", &value_type::id,
"name", &value_type::name,
"sku_id", &value_type::skuId,
"stickers", &value_type::stickers);
694 template<>
struct core<discord_core_api::guild_widget_image_data> {
695 using value_type = discord_core_api::guild_widget_image_data;
696 static constexpr auto parseValue = createValue(
"url", &value_type::url);
699 template<>
struct core<discord_core_api::guild_template_data> {
700 using value_type = discord_core_api::guild_template_data;
701 static constexpr auto parseValue = createValue(
"code", &value_type::code,
"created_at", &value_type::createdAt,
"creator", &value_type::creator,
"creator_id",
702 &value_type::creatorId,
"description", &value_type::description,
"is_dirty", &value_type::isDirty,
"name", &value_type::name,
"serialized_source_guild",
703 &value_type::serializedSourceGuild,
"source_guild_id", &value_type::sourceGuildId,
"updated_at", &value_type::updatedAt);
706 template<>
struct core<discord_core_api::application_command_option_data> {
707 using value_type = discord_core_api::application_command_option_data;
708 static constexpr auto parseValue = createValue(
"type", &value_type::type,
"name", &value_type::name,
"description", &value_type::description,
"required",
709 &value_type::required,
"autocomplete", &value_type::autocomplete,
"min_value", &value_type::minValue,
"max_value", &value_type::maxValue,
"channel_types",
710 &value_type::channelTypes,
"description_localizations", &value_type::descriptionLocalizations,
"name_localizations", &value_type::nameLocalizations,
"choices",
711 &value_type::choices,
"options", &value_type::options);
714 template<>
struct core<discord_core_api::stage_instance_data> {
715 using value_type = discord_core_api::stage_instance_data;
716 static constexpr auto parseValue = createValue(
"privacy_level", &value_type::privacyLevel,
"discoverable_disabled", &value_type::discoverableDisabled,
"channel_id",
717 &value_type::channelId,
"guild_id", &value_type::guildId,
"topic", &value_type::topic);
720 template<>
struct core<discord_core_api::application_command_option_choice_data> {
721 using value_type = discord_core_api::application_command_option_choice_data;
722 static constexpr auto parseValue = createValue(
"name", &value_type::name,
"value", &value_type::value,
"name_localizations", &value_type::nameLocalizations);
725 template<>
struct core<discord_core_api::role_tags_data> {
726 using value_type = discord_core_api::role_tags_data;
727 static constexpr auto parseValue =
728 createValue(
"premium_subscriber", &value_type::premiumSubscriber,
"integration_id", &value_type::integrationId,
"bot_id", &value_type::botId);
731 template<>
struct core<discord_core_api::discord_core_internal::connect_properties> {
732 using value_type = discord_core_api::discord_core_internal::connect_properties;
733 static constexpr auto parseValue = createValue(
"os", &value_type::os,
"device", &value_type::device,
"browser", &value_type::browser);
736 template<>
struct core<discord_core_api::discord_core_internal::websocket_identify_data> {
737 using value_type = discord_core_api::discord_core_internal::websocket_identify_data;
738 static constexpr auto parseValue = createValue(
"token", &value_type::botToken,
"shard", &value_type::shard,
"intents", &value_type::intents,
"large_threshold",
739 &value_type::largeThreshold,
"presence", &value_type::presence,
"properties", &value_type::properties);
742 template<>
struct core<discord_core_api::discord_core_internal::websocket_resume_data> {
743 using value_type = discord_core_api::discord_core_internal::websocket_resume_data;
744 static constexpr auto parseValue = createValue(
"token", &value_type::botToken,
"session_id", &value_type::sessionId,
"seq", &value_type::lastNumberReceived);
747 template<>
struct core<discord_core_api::discord_core_internal::voice_socket_protocol_payload_data_data> {
748 using value_type = discord_core_api::discord_core_internal::voice_socket_protocol_payload_data_data;
749 static constexpr auto parseValue = createValue(
"address", &value_type::address,
"mode", &value_type::mode,
"port", &value_type::port);
752 template<>
struct core<discord_core_api::discord_core_internal::voice_socket_protocol_payload_data> {
753 using value_type = discord_core_api::discord_core_internal::voice_socket_protocol_payload_data;
754 static constexpr auto parseValue = createValue(
"data", &value_type::data,
"protocol", &value_type::protocol);
757 template<>
struct core<discord_core_api::discord_core_internal::voice_identify_data> {
758 using value_type = discord_core_api::discord_core_internal::voice_identify_data;
759 static constexpr auto parseValue =
760 createValue(
"session_id", &value_type::sessionId,
"user_id", &value_type::userId,
"token", &value_type::token,
"server_id", &value_type::serverId);
763 template<>
struct core<discord_core_api::discord_core_internal::send_speaking_data> {
764 using value_type = discord_core_api::discord_core_internal::send_speaking_data;
765 static constexpr auto parseValue = createValue(
"speaking", &value_type::type,
"delay", &value_type::delay,
"ssrc", &value_type::ssrc);
768 template<>
struct core<discord_core_api::discord_core_internal::hello_data> {
769 using value_type = discord_core_api::discord_core_internal::hello_data;
770 static constexpr auto parseValue = createValue(
"heartbeat_interval", &value_type::heartbeatInterval,
"_trace", &value_type::_trace);
773 template<>
struct core<discord_core_api::update_presence_data> {
774 using value_type = discord_core_api::update_presence_data;
775 static constexpr auto parseValue =
776 createValue(
"afk", &value_type::afk,
"since", &value_type::since,
"status", &value_type::statusReal,
"activities", &value_type::activities);
779 template<
typename value_type>
struct core<discord_core_api::event_data<value_type>> {
780 using value_type02 = discord_core_api::event_data<value_type>;
781 static constexpr auto parseValue = createValue(
"d", &value_type02::value);
784 template<
typename value_type,
typename value_type01>
struct core<discord_core_api::updated_event_data<value_type, value_type01>> {
785 using value_type02 = discord_core_api::updated_event_data<value_type, value_type01>;
786 static constexpr auto parseValue = createValue(
"d", &value_type02::value);
The main namespace for the forward-facing interfaces.