From 2cd1d08bac3074ef4e45e84bd13a8797d2a23dc0 Mon Sep 17 00:00:00 2001 From: lcsmuller Date: Fri, 4 Mar 2022 18:34:05 -0300 Subject: [PATCH] refactor!(gencodecs): bitwise enumerators have been converted to macros, convert types that should be u64bitmask --- gencodecs/api/application.pre.h | 7 ++- gencodecs/api/channel.pre.h | 87 ++++++++++++++------------- gencodecs/api/gateway.pre.h | 18 +++++- gencodecs/api/guild.pre.h | 40 ++++++------ gencodecs/api/interactions.pre.h | 10 +-- gencodecs/api/permissions.pre.h | 9 ++- gencodecs/api/user.pre.h | 15 +++-- gencodecs/api/voice_connections.pre.h | 22 ++++--- gencodecs/api/webhook.pre.h | 6 +- 9 files changed, 128 insertions(+), 86 deletions(-) diff --git a/gencodecs/api/application.pre.h b/gencodecs/api/application.pre.h index 29dcee252..7e6156c86 100644 --- a/gencodecs/api/application.pre.h +++ b/gencodecs/api/application.pre.h @@ -2,6 +2,8 @@ * Application Datatypes * **************************************************************************/ +/** @defgroup DiscordApplicationFlags Application flags + * @{ */ PP_DEFINE(DISCORD_APPLICATION_GATEWAY_PRESENCE 1 << 12) PP_DEFINE(DISCORD_APPLICATION_GATEWAY_PRESENCE_LIMITED 1 << 13) PP_DEFINE(DISCORD_APPLICATION_GATEWAY_GUILD_MEMBERS 1 << 14) @@ -10,6 +12,7 @@ PP_DEFINE(DISCORD_APPLICATION_VERIFICATION_PENDING_GUILD_LIMIT 1 << 16) PP_DEFINE(DISCORD_APPLICATION_EMBEDDED 1 << 17) PP_DEFINE(DISCORD_APPLICATION_GATEWAY_MESSAGE_CONTENT 1 << 18) PP_DEFINE(DISCORD_APPLICATION_GATEWAY_MESSAGE_CONTENT_LIMITED 1 << 19) +/** @} DiscordApplicationFlags */ /** @CCORD_pub_struct{discord_application} */ PUB_STRUCT(discord_application) @@ -60,6 +63,6 @@ PUB_STRUCT(discord_application) FIELD_PTR(slug, char, *) /** the application's default rich presence invite cover image hash */ FIELD_PTR(cover_image, char, *) - /** the application's public flags */ - FIELD_SNOWFLAKE(flags) + /** the application's public flags @see DiscordApplicationFlags */ + FIELD_BITMASK(flags) STRUCT_END diff --git a/gencodecs/api/channel.pre.h b/gencodecs/api/channel.pre.h index 5e3cd2fb9..de56b00a9 100644 --- a/gencodecs/api/channel.pre.h +++ b/gencodecs/api/channel.pre.h @@ -2,6 +2,35 @@ * Channel Datatypes * **************************************************************************/ +/** @defgroup DiscordAPIChannelMessageFlags Message flags + * @ingroup DiscordAPIChannel + * @{ */ + +/** this message has been published to subscribed channels (via Channel + Following) */ +PP_DEFINE(DISCORD_MESSAGE_CROSSPOSTED 1 << 0) +/** this message originated from a message in another channel (via Channel + Following) */ +PP_DEFINE(DISCORD_MESSAGE_IS_CROSSPOST 1 << 1) +/** do not include any embed when serializing this message */ +PP_DEFINE(DISCORD_MESSAGE_SUPRPRESS_EMBEDS 1 << 2) +/** the source message for this crosspost has been deleted (via Channel + Following) */ +PP_DEFINE(DISCORD_MESSAGE_SOURCE_MESSAGE_DELETED 1 << 3) +/** this message came from the urgent message system */ +PP_DEFINE(DISCORD_MESSAGE_URGENT 1 << 4) +/** this message has an associated thread, with the same ID as the message */ +PP_DEFINE(DISCORD_MESSAGE_HAS_THREAD 1 << 5) +/** this message is only visible to the user who invoked the interaction */ +PP_DEFINE(DISCORD_MESSAGE_EPHEMERAL 1 << 6) +/** this message is an interaction response and the bot is thinking */ +PP_DEFINE(DISCORD_MESSAGE_LOADING 1 << 7) +/** this message failed to mention some roles and add the members to the + thread */ +PP_DEFINE(DISCORD_MESSAGE_FAILED_TO_MENTION_SOME_ROLES_IN_THREAD 1 << 8) + +/** @} DiscordAPIChannelMessageFlags */ + ENUM(discord_channel_types) /** a text channel within a server */ ENUMERATOR(DISCORD_CHANNEL_GUILD_TEXT, = 0) @@ -71,32 +100,6 @@ ENUM(discord_message_activity_types) ENUMERATOR_LAST(DISCORD_MESSAGE_ACTIVITY_JOIN_REQUEST, = 5) ENUM_END -ENUM(discord_message_flags) - /** this message has been published to subscribed channels (via Channel - Following) */ - ENUMERATOR(DISCORD_MESSAGE_CROSSPOSTED, = 1 << 0) - /** this message originated from a message in another channel (via Channel - Following) */ - ENUMERATOR(DISCORD_MESSAGE_IS_CROSSPOST, = 1 << 1) - /** do not include any embed when serializing this message */ - ENUMERATOR(DISCORD_MESSAGE_SUPRPRESS_EMBEDS, = 1 << 2) - /** the source message for this crosspost has been deleted (via Channel - Following) */ - ENUMERATOR(DISCORD_MESSAGE_SOURCE_MESSAGE_DELETED, = 1 << 3) - /** this message came from the urgent message system */ - ENUMERATOR(DISCORD_MESSAGE_URGENT, = 1 << 4) - /** this message has an associated thread, with the same ID as the message */ - ENUMERATOR(DISCORD_MESSAGE_HAS_THREAD, = 1 << 5) - /** this message is only visible to the user who invoked the interaction */ - ENUMERATOR(DISCORD_MESSAGE_EPHEMERAL, = 1 << 6) - /** this message is an interaction response and the bot is thinking */ - ENUMERATOR(DISCORD_MESSAGE_LOADING, = 1 << 7) - /** this message failed to mention some roles and add the members to the - thread */ - ENUMERATOR_LAST(DISCORD_MESSAGE_FAILED_TO_MENTION_SOME_ROLES_IN_THREAD, - = 1 << 8) -ENUM_END - /** @CCORD_pub_struct{discord_channel} */ PUB_STRUCT(discord_channel) /** the ID of this channel */ @@ -228,8 +231,8 @@ PUB_STRUCT(discord_message) /** data showing the source of a crosspost, channel follow add, pin, or reply message */ FIELD_STRUCT_PTR(message_reference, discord_message_reference, *) - /** message flags combined as a bitfield */ - FIELD_ENUM(flags, discord_message_flags) + /** @ref DiscordAPIChannelMessageFlags combined as a bitfield */ + FIELD_BITMASK(flags) /** the message associated with the message_reference */ FIELD_STRUCT_PTR(referenced_message, discord_message, *) /** sent if the message is a response to an interaction */ @@ -294,9 +297,9 @@ STRUCT(discord_overwrite) FIELD_SNOWFLAKE(id) /** either 0 (role) or 1 (member) */ FIELD(type, int, 0) - /** permission bit set */ + /** @ref DiscordPermissions bit set */ FIELD_SNOWFLAKE(allow) - /** permission bit set */ + /** @ref DiscordPermissions bit set */ FIELD_SNOWFLAKE(deny) STRUCT_END @@ -332,7 +335,7 @@ STRUCT(discord_thread_member) /** the time the current user last joined the thread */ FIELD_TIMESTAMP(join_timestamp) /** any user-thread settings, currently only used for notifications */ - FIELD(flags, int, 0) + FIELD_BITMASK(flags) STRUCT_END /** @CCORD_pub_list{discord_thread_members} */ @@ -707,10 +710,10 @@ PUB_STRUCT(discord_create_message) COND_WRITE(this->attachments != NULL) FIELD_STRUCT_PTR(attachments, discord_attachments, *) COND_END - /** message flags combined as a bitfield (only `SUPPRESS_EMBEDS` can be - set */ + /** @ref DiscordAPIChannelMessageFlags combined as a bitfield (only + `SUPPRESS_EMBEDS` can be set) */ COND_WRITE(this->flags != 0) - FIELD_ENUM(flags, discord_message_flags) + FIELD_BITMASK(flags) COND_END STRUCT_END @@ -734,10 +737,10 @@ PUB_STRUCT(discord_edit_message) FIELD_PTR(content, char, *) /** embedded `rich` content (up to 6000 characters) */ FIELD_STRUCT_PTR(embeds, discord_embeds, *) - /** message flags combined as a bitfield (only `SUPPRESS_EMBEDS` can be - set */ + /** @ref DiscordAPIChannelMessageFlags combined as a bitfield (only + `SUPPRESS_EMBEDS` can be set) */ COND_WRITE(this->flags != 0) - FIELD_ENUM(flags, discord_message_flags) + FIELD_BITMASK(flags) COND_END /** allowed mentions for the message */ COND_WRITE(this->allowed_mentions != NULL) @@ -761,13 +764,15 @@ STRUCT_END /** @CCORD_pub_struct{discord_edit_channel_permissions} */ PUB_STRUCT(discord_edit_channel_permissions) - /** the bitwise value of all allowed permissions (default \"0\") */ + /** the bitwise value of all allowed permissions (default \"0\") + @see @ref DiscordPermissions */ COND_WRITE(this->allow != 0) - FIELD_PRINTF(allow, u64bitmask, "%" PRIu64, "%" SCNu64) + FIELD_BITMASK(allow) COND_END - /** the bitwise value of all disallowed permissions (default \"0\") */ + /** the bitwise value of all disallowed permissions (default \"0\") + @see @ref DiscordPermissions */ COND_WRITE(this->deny != 0) - FIELD_PRINTF(deny, u64bitmask, "%" PRIu64, "%" SCNu64) + FIELD_BITMASK(deny) COND_END /** 0 for a role or 1 for a member */ FIELD(type, int, 0) diff --git a/gencodecs/api/gateway.pre.h b/gencodecs/api/gateway.pre.h index cc5157a5f..a7044c5e9 100644 --- a/gencodecs/api/gateway.pre.h +++ b/gencodecs/api/gateway.pre.h @@ -2,6 +2,10 @@ * Gateway Datatypes * **************************************************************************/ +/** @defgroup DiscordInternalGatewayIntents Gateway intents + * @brief Events user is interested on listening to + * @ingroup DiscordInternalGateway + * @{ */ PP_DEFINE(DISCORD_GATEWAY_GUILDS 1 << 0) PP_DEFINE(DISCORD_GATEWAY_GUILD_MEMBERS 1 << 1) PP_DEFINE(DISCORD_GATEWAY_GUILD_BANS 1 << 2) @@ -17,7 +21,12 @@ PP_DEFINE(DISCORD_GATEWAY_GUILD_MESSAGE_TYPING 1 << 11) PP_DEFINE(DISCORD_GATEWAY_DIRECT_MESSAGES 1 << 12) PP_DEFINE(DISCORD_GATEWAY_DIRECT_MESSAGE_REACTIONS 1 << 13) PP_DEFINE(DISCORD_GATEWAY_DIRECT_MESSAGE_TYPING 1 << 14) +/** @} DiscordInternalGatewayIntents */ +/** @defgroup DiscordActivityFlags Gateway activity flags + * @brief Describe user activities + * @ingroup DiscordConstants + * @{ */ PP_DEFINE(DISCORD_ACTIVITY_INSTANCE 1 << 0) PP_DEFINE(DISCORD_ACTIVITY_JOIN 1 << 1) PP_DEFINE(DISCORD_ACTIVITY_SPECTATE 1 << 2) @@ -27,6 +36,7 @@ PP_DEFINE(DISCORD_ACTIVITY_PLAY 1 << 5) PP_DEFINE(DISCORD_ACTIVITY_PARTY_PRIVACY_FRIENDS 1 << 6) PP_DEFINE(DISCORD_ACTIVITY_PARTY_PRIVACY_VOICE_CHANNEL 1 << 7) PP_DEFINE(DISCORD_ACTIVITY_EMBEDDED 1 << 8) +/** @} DiscordActivityFlags */ ENUM(discord_gateway_close_opcodes) ENUMERATOR(DISCORD_GATEWAY_CLOSE_REASON_UNKNOWN_ERROR, = 4000) @@ -149,7 +159,8 @@ PUB_STRUCT(discord_identify) #endif /** presence structure for initial presence information */ FIELD_STRUCT_PTR(presence, discord_presence_update, *) - /** the gateway intents you wish to receive */ + /** the gateway intents you wish to receive + @see @ref DiscordInternalGatewayIntents */ FIELD_BITMASK(intents) STRUCT_END @@ -247,8 +258,9 @@ STRUCT(discord_activity) COND_END /** whether or not the activity is an instanced game session */ FIELD(instance, bool, false) - /** activity flags bitwise mask, describes what they payload includes */ - FIELD_SNOWFLAKE(flags) + /** activity flags bitwise mask, describes what they payload includes + @see @ref DiscordActivityFlags */ + FIELD_BITMASK(flags) /** the custom buttons shown in the Rich Presence (max 2) */ COND_WRITE(this->buttons != NULL) FIELD_STRUCT_PTR(buttons, discord_activity_buttons, *) diff --git a/gencodecs/api/guild.pre.h b/gencodecs/api/guild.pre.h index f18b66a22..6ad1ad9fa 100644 --- a/gencodecs/api/guild.pre.h +++ b/gencodecs/api/guild.pre.h @@ -2,6 +2,21 @@ * Guild Datatypes * **************************************************************************/ +/** @defgroup DiscordAPIGuildSystemChannelFlags System channel flags + * @ingroup DiscordAPIGuild + * @{ */ + +/** suppress member join notifications */ +PP_DEFINE(DISCORD_SYSTEM_SUPPRESS_JOIN_NOTIFICATIONS 1 << 0) +/** suppress server boost notifications */ +PP_DEFINE(DISCORD_SYSTEM_SUPPRESS_PREMIUM_NOTIFICATIONS 1 << 1) +/** suppress server setup tips */ +PP_DEFINE(DISCORD_SYSTEM_SUPPRESS_GUILD_REMINDER_NOTIFICATIONS 1 << 2) +/** hide member join sticker reply buttons */ +PP_DEFINE(DISCORD_SYSTEM_SUPPRESS_JOIN_NOTIFICATION_REPLIES 1 << 3) + +/** @} DiscordAPIGuildSystemChannelFlags */ + ENUM(discord_message_notification_level) /** members will receive notifications for all messages by default */ ENUMERATOR(DISCORD_MESSAGE_NOTIFICATION_ALL_MESSAGES, = 0) @@ -57,17 +72,6 @@ ENUM(discord_premium_tier) ENUMERATOR_LAST(DISCORD_PREMIUM_TIER_3, = 3) ENUM_END -ENUM(discord_system_channel_flags) - /** suppress member join notifications */ - ENUMERATOR(DISCORD_SYSTEM_SUPPRESS_JOIN_NOTIFICATIONS, = 1 << 0) - /** suppress server boost notifications */ - ENUMERATOR(DISCORD_SYSTEM_SUPPRESS_PREMIUM_NOTIFICATIONS, = 1 << 1) - /** suppress server setup tips */ - ENUMERATOR(DISCORD_SYSTEM_SUPPRESS_GUILD_REMINDER_NOTIFICATIONS, = 1 << 2) - /** hide member join sticker reply buttons */ - ENUMERATOR_LAST(DISCORD_SYSTEM_SUPPRESS_JOIN_NOTIFICATION_REPLIES, = 1 << 3) -ENUM_END - ENUM(discord_integration_expire_behaviors) ENUMERATOR(DISCORD_INTEGRATION_REMOVE_ROLE, = 0) ENUMERATOR_LAST(DISCORD_INTEGRATION_KICK, = 1) @@ -94,7 +98,7 @@ PUB_STRUCT(discord_guild) FIELD(owner, bool, false) /** id of owner */ FIELD_SNOWFLAKE(owner_id) - /** total permissions for the user in the guild (exclues overwrites) */ + /** total permissions for the user in the guild (excludes overwrites) */ COND_WRITE(this->permissions != NULL) FIELD_PTR(permissions, char, *) COND_END @@ -126,8 +130,8 @@ PUB_STRUCT(discord_guild) /** the id of the channel where guild notices such as welcome messages and boost events are posted */ FIELD_SNOWFLAKE(system_channel_id) - /** system channel flags */ - FIELD_ENUM(system_channel_flags, discord_system_channel_flags) + /** @ref DiscordAPIGuildSystemChannelFlags */ + FIELD_BITMASK(system_channel_flags) /** the id of the channel where Community guilds can display rules and/or guidelines */ FIELD_SNOWFLAKE(rules_channel_id) @@ -462,8 +466,8 @@ PUB_STRUCT(discord_create_guild) /** the ID of the channel when guild notices such as welcome messages and boost events are posted */ FIELD_SNOWFLAKE(system_channel_id) - /** system channel flags */ - FIELD_ENUM(system_channel_flags, discord_system_channel_flags) + /** @ref DiscordAPIGuildSystemChannelFlags */ + FIELD_BITMASK(system_channel_flags) STRUCT_END /** @CCORD_pub_struct{discord_modify_guild} */ @@ -497,8 +501,8 @@ PUB_STRUCT(discord_modify_guild) /** the ID of the channel when guild notices such as welcome messages and boost events are posted */ FIELD_SNOWFLAKE(system_channel_id) - /** system channel flags */ - FIELD_ENUM(system_channel_flags, discord_system_channel_flags) + /** @ref DiscordAPIGuildSystemChannelFlags */ + FIELD_BITMASK(system_channel_flags) /** the ID of the channel where Community guilds display rules and/or guidelines */ FIELD_SNOWFLAKE(rules_channel_id) diff --git a/gencodecs/api/interactions.pre.h b/gencodecs/api/interactions.pre.h index d8161de98..5e5ae9c7a 100644 --- a/gencodecs/api/interactions.pre.h +++ b/gencodecs/api/interactions.pre.h @@ -138,11 +138,11 @@ STRUCT(discord_interaction_callback_data) COND_WRITE(this->embeds != NULL) FIELD_STRUCT_PTR(embeds, discord_embeds, *) COND_END - /** message flags combined as a bitfield (only + /** @ref DiscordAPIChannelMessageFlags combined as a bitfield (only @ref DISCORD_MESSAGE_SUPRESS_EMBEDS and @ref DISCORD_MESSAGE_EPHEMERAL can be set) */ COND_WRITE(this->flags != 0) - FIELD_ENUM(flags, discord_message_flags) + FIELD_BITMASK(flags) COND_END /** attachment objects with filename and description */ COND_WRITE(this->attachments != NULL) @@ -222,10 +222,10 @@ PUB_STRUCT(discord_create_followup_message) COND_WRITE(this->attachments != NULL) FIELD_STRUCT_PTR(attachments, discord_attachments, *) COND_END - /** message flags combined as a bitfield (only `SUPPRESS_EMBEDS` can be - set) */ + /** @ref DiscordAPIChannelMessageFlags combined as a bitfield (only + `SUPPRESS_EMBEDS` can be set) */ COND_WRITE(this->flags != 0) - FIELD_SNOWFLAKE(flags) + FIELD_BITMASK(flags) COND_END STRUCT_END diff --git a/gencodecs/api/permissions.pre.h b/gencodecs/api/permissions.pre.h index e2f262d17..8520ba2f9 100644 --- a/gencodecs/api/permissions.pre.h +++ b/gencodecs/api/permissions.pre.h @@ -2,6 +2,11 @@ * Permissions Datatypes * **************************************************************************/ +/** @defgroup DiscordPermissions Discord permissions + * @see https://discord.com/developers/docs/topics/permissions#permissions + * @ingroup DiscordConstants + * @{ */ + /** Allows creation of instant invites */ PP_DEFINE(DISCORD_PERM_CREATE_INSTANT_INVITE 1 << 0) /** Allows kicking members */ @@ -93,6 +98,8 @@ PP_DEFINE(DISCORD_PERM_START_EMBEDDED_ACTIVITIES 1 << 39) channels */ PP_DEFINE(DISCORD_PERM_MODERATE_MEMBERS 1 << 40) +/** @} DiscordPermissions */ + /** @CCORD_pub_struct{discord_role} */ PUB_STRUCT(discord_role) /** role id */ @@ -114,7 +121,7 @@ PUB_STRUCT(discord_role) /** position of this role */ FIELD(position, int, 0) /** permission bit set */ - FIELD_PTR(permissions, char, *) + FIELD_BITMASK(permissions) /** whether this role is managed by an integration */ FIELD(managed, bool, false) /** whether this roleis mentionable */ diff --git a/gencodecs/api/user.pre.h b/gencodecs/api/user.pre.h index 5c9e5dfe9..d9fabfd19 100644 --- a/gencodecs/api/user.pre.h +++ b/gencodecs/api/user.pre.h @@ -2,6 +2,11 @@ * User Datatypes * **************************************************************************/ +/** @defgroup DiscordAPIUserFlags User flags + * @brief Flags on a user account + * @ingroup DiscordAPIUser + * @{ */ + /** None */ PP_DEFINE(DISCORD_USER_NONE 0) /** Discord Employee */ @@ -33,6 +38,8 @@ PP_DEFINE(DISCORD_USER_CERTIFIED_MODERATOR 1 << 18) /** Bot uses only HTTP interactions and is shownin the online member list */ PP_DEFINE(DISCORD_USER_BOT_HTTP_INTERACTIONS 1 << 19) +/** @} DiscordAPIUserFlags */ + ENUM(discord_premium_types) ENUMERATOR(DISCORD_PREMIUM_NONE, = 0) ENUMERATOR(DISCORD_PREMIUM_NITRO_CLASSIC, = 1) @@ -76,12 +83,12 @@ PUB_STRUCT(discord_user) FIELD(verified, bool, false) /** the user's email */ FIELD_PTR(email, char, *) - /** the flags on a user's account */ - FIELD_SNOWFLAKE(flags) + /** the @ref DiscordAPIUserFlags on a user's account */ + FIELD_BITMASK(flags) /** the type of Nitro subscription on a user's account */ FIELD_ENUM(premium_type, discord_premium_types) - /** the public flags on a user's account */ - FIELD_SNOWFLAKE(public_flags) + /** the public @ref DiscordAPIUserFlags on a user's account */ + FIELD_BITMASK(public_flags) STRUCT_END /** @CCORD_pub_list{discord_users} */ diff --git a/gencodecs/api/voice_connections.pre.h b/gencodecs/api/voice_connections.pre.h index 2d7003308..d63067837 100644 --- a/gencodecs/api/voice_connections.pre.h +++ b/gencodecs/api/voice_connections.pre.h @@ -2,6 +2,19 @@ * Voice Connections Datatypes * **************************************************************************/ +/** @defgroup DiscordVoiceSpeakingFlags Voice speaking flags + * @ingroup DiscordConstants + * @{ */ + +/** Normal transmission of voice audio */ +PP_DEFINE(DISCORD_VOICE_MICROPHONE 1 << 0) +/** Transmission of context audio for video, no speaking indicators */ +PP_DEFINE(DISCORD_VOICE_SOUNDSHARE 1 << 1) +/** Priority speaker, lowering audio of other speakers */ +PP_DEFINE(DISCORD_VOICE_PRIORITY 1 << 2) + +/** @} DiscordVoiceSpeakingFlags */ + ENUM(discord_voice_close_opcodes) /** You sent an invalid opcode */ ENUMERATOR(DISCORD_VOICE_CLOSE_REASON_UNKNOWN_OPCODE, = 4001) @@ -55,12 +68,3 @@ ENUM(discord_voice_opcodes) ENUMERATOR(DISCORD_VOICE_CLIENT_DISCONNECT, = 13) ENUMERATOR_LAST(DISCORD_VOICE_CODEC, = 14) ENUM_END - -ENUM(discord_voice_speaking_flags) - /** Normal transmission of voice audio */ - ENUMERATOR(DISCORD_VOICE_MICROPHONE, = 1 << 0) - /** Transmission of context audio for video, no speaking indicators */ - ENUMERATOR(DISCORD_VOICE_SOUNDSHARE, = 1 << 1) - /** Priority speaker, lowering audio of other speakers */ - ENUMERATOR_LAST(DISCORD_VOICE_PRIORITY, = 1 << 2) -ENUM_END diff --git a/gencodecs/api/webhook.pre.h b/gencodecs/api/webhook.pre.h index 0fa77b1c8..e8ffcdc26 100644 --- a/gencodecs/api/webhook.pre.h +++ b/gencodecs/api/webhook.pre.h @@ -126,10 +126,10 @@ PUB_STRUCT(discord_execute_webhook) COND_WRITE(this->attachments != NULL) FIELD_STRUCT_PTR(attachments, discord_attachments, *) COND_END - /** message flags combined as a bitfield (only `SUPPRESS_EMBEDS` can be - set) */ + /** @ref DiscordAPIChannelMessageFlags combined as a bitfield (only + `SUPPRESS_EMBEDS` can be set) */ COND_WRITE(this->flags != 0) - FIELD_SNOWFLAKE(flags) + FIELD_BITMASK(flags) COND_END STRUCT_END