Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(admin): show embeds and webhook badges in message tools (#3697)

Hampus8d0be9321620
diff --git a/fluxer_admin/openapi-admin.json b/fluxer_admin/openapi-admin.json
index 7666c5a5f..ee54b20f2 100644
--- a/fluxer_admin/openapi-admin.json
+++ b/fluxer_admin/openapi-admin.json
@@ -20299,6 +20299,8 @@
"author_global_name": {"nullable": true, "type": "string"},
"author_discriminator": {"type": "string", "minLength": 1, "maxLength": 10},
"author_avatar": {"nullable": true, "type": "string"},
+ "author_bot": {"type": "boolean"},
+ "webhook_id": {"nullable": true, "allOf": [{"$ref": "#/components/schemas/SnowflakeStringType"}]},
"content": {"type": "string", "maxLength": 4000},
"timestamp": {"type": "string"},
"attachments": {
@@ -20319,7 +20321,8 @@
"required": ["id", "filename", "url", "nsfw", "content_type", "width", "height"],
"additionalProperties": false
}
- }
+ },
+ "embeds": {"type": "array", "items": {"$ref": "#/components/schemas/MessageEmbedResponse"}}
},
"required": [
"id",
@@ -20340,6 +20343,96 @@
],
"additionalProperties": false
},
+ "MessageEmbedResponse": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "The type of embed (e.g., rich, image, video, gifv, article, link)"
+ },
+ "url": {"description": "The URL of the embed", "nullable": true, "type": "string", "format": "uri"},
+ "title": {"description": "The title of the embed", "nullable": true, "type": "string"},
+ "color": {
+ "description": "The color code of the embed sidebar",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
+ },
+ "timestamp": {
+ "description": "The ISO 8601 timestamp of the embed content",
+ "nullable": true,
+ "type": "string",
+ "format": "date-time",
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
+ },
+ "description": {"description": "The description of the embed", "nullable": true, "type": "string"},
+ "author": {
+ "description": "The author information of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedAuthorResponse"}]
+ },
+ "image": {
+ "description": "The image of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
+ },
+ "thumbnail": {
+ "description": "The thumbnail of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
+ },
+ "footer": {
+ "description": "The footer of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedFooterResponse"}]
+ },
+ "fields": {
+ "description": "The fields of the embed",
+ "nullable": true,
+ "type": "array",
+ "items": {"$ref": "#/components/schemas/EmbedFieldResponse"}
+ },
+ "provider": {
+ "description": "The provider of the embed (e.g., YouTube, Twitter)",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedProviderResponse"}]
+ },
+ "video": {
+ "description": "The video of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
+ },
+ "audio": {
+ "description": "The audio of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
+ },
+ "html": {
+ "description": "Sanitized oEmbed HTML for trusted specialized embed renderers",
+ "nullable": true,
+ "type": "string"
+ },
+ "html_width": {
+ "description": "The preferred width of sanitized oEmbed HTML",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
+ },
+ "html_height": {
+ "description": "The preferred height of sanitized oEmbed HTML",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
+ },
+ "nsfw": {"description": "Whether the embed is flagged as NSFW", "nullable": true, "type": "boolean"},
+ "children": {
+ "description": "Internal nested embeds generated by unfurlers",
+ "nullable": true,
+ "maxItems": 1,
+ "type": "array",
+ "items": {"$ref": "#/components/schemas/MessageEmbedChildResponse"}
+ }
+ },
+ "required": ["type"],
+ "additionalProperties": false
+ },
"NonNegativeSafeIntegerType": {"type": "integer", "minimum": 0, "maximum": 9007199254740991},
"ContentWarningLevel": {
"description": "The content warning level for a guild, category, or channel",
@@ -20360,6 +20453,198 @@
"x-enumNames": ["SAFE", "AGE_RESTRICTED"],
"x-enumDescriptions": ["Guild is safe for all ages", "Guild is age-restricted"]
},
+ "MessageEmbedChildResponse": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "The type of embed (e.g., rich, image, video, gifv, article, link)"
+ },
+ "url": {"description": "The URL of the embed", "nullable": true, "type": "string", "format": "uri"},
+ "title": {"description": "The title of the embed", "nullable": true, "type": "string"},
+ "color": {
+ "description": "The color code of the embed sidebar",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
+ },
+ "timestamp": {
+ "description": "The ISO 8601 timestamp of the embed content",
+ "nullable": true,
+ "type": "string",
+ "format": "date-time",
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
+ },
+ "description": {"description": "The description of the embed", "nullable": true, "type": "string"},
+ "author": {
+ "description": "The author information of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedAuthorResponse"}]
+ },
+ "image": {
+ "description": "The image of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
+ },
+ "thumbnail": {
+ "description": "The thumbnail of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
+ },
+ "footer": {
+ "description": "The footer of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedFooterResponse"}]
+ },
+ "fields": {
+ "description": "The fields of the embed",
+ "nullable": true,
+ "type": "array",
+ "items": {"$ref": "#/components/schemas/EmbedFieldResponse"}
+ },
+ "provider": {
+ "description": "The provider of the embed (e.g., YouTube, Twitter)",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedProviderResponse"}]
+ },
+ "video": {
+ "description": "The video of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
+ },
+ "audio": {
+ "description": "The audio of the embed",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
+ },
+ "html": {
+ "description": "Sanitized oEmbed HTML for trusted specialized embed renderers",
+ "nullable": true,
+ "type": "string"
+ },
+ "html_width": {
+ "description": "The preferred width of sanitized oEmbed HTML",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
+ },
+ "html_height": {
+ "description": "The preferred height of sanitized oEmbed HTML",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
+ },
+ "nsfw": {"description": "Whether the embed is flagged as NSFW", "nullable": true, "type": "boolean"}
+ },
+ "required": ["type"],
+ "additionalProperties": false
+ },
+ "EmbedMediaResponse": {
+ "type": "object",
+ "properties": {
+ "url": {"type": "string", "description": "The URL of the media"},
+ "proxy_url": {
+ "description": "The proxied URL of the media",
+ "nullable": true,
+ "type": "string",
+ "format": "uri"
+ },
+ "content_type": {"description": "The MIME type of the media", "nullable": true, "type": "string"},
+ "content_hash": {"description": "The hash of the media content", "nullable": true, "type": "string"},
+ "width": {
+ "description": "The width of the media in pixels",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
+ },
+ "height": {
+ "description": "The height of the media in pixels",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
+ },
+ "description": {"description": "The description of the media", "nullable": true, "type": "string"},
+ "placeholder": {
+ "description": "The base64 encoded placeholder image for lazy loading",
+ "nullable": true,
+ "type": "string"
+ },
+ "duration": {
+ "description": "The duration of the media in seconds",
+ "nullable": true,
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
+ },
+ "flags": {"allOf": [{"$ref": "#/components/schemas/EmbedMediaFlags"}]}
+ },
+ "required": ["url", "flags"],
+ "additionalProperties": false
+ },
+ "EmbedProviderResponse": {
+ "type": "object",
+ "properties": {
+ "name": {"type": "string", "description": "The name of the provider"},
+ "url": {"description": "The URL of the provider", "nullable": true, "type": "string", "format": "uri"}
+ },
+ "required": ["name"],
+ "additionalProperties": false
+ },
+ "EmbedFieldResponse": {
+ "type": "object",
+ "properties": {
+ "name": {"type": "string", "description": "The name of the field"},
+ "value": {"type": "string", "description": "The value of the field"},
+ "inline": {"type": "boolean", "description": "Whether the field should be displayed inline"}
+ },
+ "required": ["name", "value", "inline"],
+ "additionalProperties": false
+ },
+ "EmbedFooterResponse": {
+ "type": "object",
+ "properties": {
+ "text": {"type": "string", "description": "The footer text"},
+ "icon_url": {
+ "description": "The URL of the footer icon",
+ "nullable": true,
+ "type": "string",
+ "format": "uri"
+ },
+ "proxy_icon_url": {
+ "description": "The proxied URL of the footer icon",
+ "nullable": true,
+ "type": "string",
+ "format": "uri"
+ }
+ },
+ "required": ["text"],
+ "additionalProperties": false
+ },
+ "EmbedAuthorResponse": {
+ "type": "object",
+ "properties": {
+ "name": {"type": "string", "description": "The name of the author"},
+ "url": {"description": "The URL of the author", "nullable": true, "type": "string", "format": "uri"},
+ "icon_url": {
+ "description": "The URL of the author icon",
+ "nullable": true,
+ "type": "string",
+ "format": "uri"
+ },
+ "proxy_icon_url": {
+ "description": "The proxied URL of the author icon",
+ "nullable": true,
+ "type": "string",
+ "format": "uri"
+ }
+ },
+ "required": ["name"],
+ "additionalProperties": false
+ },
+ "EmbedMediaFlags": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 2147483647,
+ "description": "The bitwise flags for this media",
+ "format": "int32",
+ "x-bitflagValues": [
+ {"name": "CONTAINS_EXPLICIT_MEDIA", "value": "16", "description": "Embed media contains explicit content"},
+ {"name": "IS_ANIMATED", "value": "32", "description": "Embed media is animated"}
+ ]
+ },
"ThreadChannelResponse": {
"type": "object",
"properties": {
@@ -20686,149 +20971,59 @@
},
"name": {"type": "string", "description": "The name of the sticker"},
"animated": {"type": "boolean", "description": "Whether the sticker is animated"}
- },
- "required": ["id", "name", "animated"],
- "additionalProperties": false
- },
- "MessageAttachmentResponse": {
- "type": "object",
- "properties": {
- "id": {
- "description": "The unique identifier for this attachment",
- "allOf": [{"$ref": "#/components/schemas/SnowflakeStringType"}]
- },
- "filename": {"type": "string", "description": "The name of the attached file"},
- "title": {"description": "The title of the attachment", "nullable": true, "type": "string"},
- "description": {"description": "The description of the attachment", "nullable": true, "type": "string"},
- "content_type": {"description": "The MIME type of the attachment", "nullable": true, "type": "string"},
- "content_hash": {"description": "The hash of the attachment content", "nullable": true, "type": "string"},
- "size": {
- "description": "The size of the attachment in bytes",
- "allOf": [{"$ref": "#/components/schemas/NonNegativeSafeIntegerType"}]
- },
- "url": {"description": "The URL of the attachment", "nullable": true, "type": "string"},
- "proxy_url": {"description": "The proxied URL of the attachment", "nullable": true, "type": "string"},
- "width": {
- "description": "The width of the attachment in pixels (for images/videos)",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
- },
- "height": {
- "description": "The height of the attachment in pixels (for images/videos)",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
- },
- "placeholder": {
- "description": "The base64 encoded placeholder image for lazy loading",
- "nullable": true,
- "type": "string"
- },
- "flags": {"allOf": [{"$ref": "#/components/schemas/MessageAttachmentFlags"}]},
- "nsfw": {"description": "Whether the attachment is flagged as NSFW", "nullable": true, "type": "boolean"},
- "duration": {
- "description": "The duration of the media in seconds",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
- },
- "waveform": {"description": "The base64 encoded audio waveform data", "nullable": true, "type": "string"},
- "expires_at": {
- "description": "The ISO 8601 timestamp when the attachment URL expires",
- "nullable": true,
- "type": "string"
- },
- "expired": {"description": "Whether the attachment URL has expired", "nullable": true, "type": "boolean"}
- },
- "required": ["id", "filename", "size", "flags"],
- "additionalProperties": false
- },
- "MessageEmbedResponse": {
- "type": "object",
- "properties": {
- "type": {
- "type": "string",
- "description": "The type of embed (e.g., rich, image, video, gifv, article, link)"
- },
- "url": {"description": "The URL of the embed", "nullable": true, "type": "string", "format": "uri"},
- "title": {"description": "The title of the embed", "nullable": true, "type": "string"},
- "color": {
- "description": "The color code of the embed sidebar",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
- },
- "timestamp": {
- "description": "The ISO 8601 timestamp of the embed content",
- "nullable": true,
- "type": "string",
- "format": "date-time",
- "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
- },
- "description": {"description": "The description of the embed", "nullable": true, "type": "string"},
- "author": {
- "description": "The author information of the embed",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedAuthorResponse"}]
- },
- "image": {
- "description": "The image of the embed",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
- },
- "thumbnail": {
- "description": "The thumbnail of the embed",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
- },
- "footer": {
- "description": "The footer of the embed",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedFooterResponse"}]
- },
- "fields": {
- "description": "The fields of the embed",
- "nullable": true,
- "type": "array",
- "items": {"$ref": "#/components/schemas/EmbedFieldResponse"}
+ },
+ "required": ["id", "name", "animated"],
+ "additionalProperties": false
+ },
+ "MessageAttachmentResponse": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "description": "The unique identifier for this attachment",
+ "allOf": [{"$ref": "#/components/schemas/SnowflakeStringType"}]
},
- "provider": {
- "description": "The provider of the embed (e.g., YouTube, Twitter)",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedProviderResponse"}]
+ "filename": {"type": "string", "description": "The name of the attached file"},
+ "title": {"description": "The title of the attachment", "nullable": true, "type": "string"},
+ "description": {"description": "The description of the attachment", "nullable": true, "type": "string"},
+ "content_type": {"description": "The MIME type of the attachment", "nullable": true, "type": "string"},
+ "content_hash": {"description": "The hash of the attachment content", "nullable": true, "type": "string"},
+ "size": {
+ "description": "The size of the attachment in bytes",
+ "allOf": [{"$ref": "#/components/schemas/NonNegativeSafeIntegerType"}]
},
- "video": {
- "description": "The video of the embed",
+ "url": {"description": "The URL of the attachment", "nullable": true, "type": "string"},
+ "proxy_url": {"description": "The proxied URL of the attachment", "nullable": true, "type": "string"},
+ "width": {
+ "description": "The width of the attachment in pixels (for images/videos)",
"nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
},
- "audio": {
- "description": "The audio of the embed",
+ "height": {
+ "description": "The height of the attachment in pixels (for images/videos)",
"nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
+ "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
},
- "html": {
- "description": "Sanitized oEmbed HTML for trusted specialized embed renderers",
+ "placeholder": {
+ "description": "The base64 encoded placeholder image for lazy loading",
"nullable": true,
"type": "string"
},
- "html_width": {
- "description": "The preferred width of sanitized oEmbed HTML",
+ "flags": {"allOf": [{"$ref": "#/components/schemas/MessageAttachmentFlags"}]},
+ "nsfw": {"description": "Whether the attachment is flagged as NSFW", "nullable": true, "type": "boolean"},
+ "duration": {
+ "description": "The duration of the media in seconds",
"nullable": true,
"allOf": [{"$ref": "#/components/schemas/Int32Type"}]
},
- "html_height": {
- "description": "The preferred height of sanitized oEmbed HTML",
+ "waveform": {"description": "The base64 encoded audio waveform data", "nullable": true, "type": "string"},
+ "expires_at": {
+ "description": "The ISO 8601 timestamp when the attachment URL expires",
"nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
+ "type": "string"
},
- "nsfw": {"description": "Whether the embed is flagged as NSFW", "nullable": true, "type": "boolean"},
- "children": {
- "description": "Internal nested embeds generated by unfurlers",
- "nullable": true,
- "maxItems": 1,
- "type": "array",
- "items": {"$ref": "#/components/schemas/MessageEmbedChildResponse"}
- }
+ "expired": {"description": "Whether the attachment URL has expired", "nullable": true, "type": "boolean"}
},
- "required": ["type"],
+ "required": ["id", "filename", "size", "flags"],
"additionalProperties": false
},
"UserPartialResponse": {
@@ -20974,198 +21169,6 @@
{"name": "SPAMMER", "value": "64", "description": "User is flagged as a spammer"}
]
},
- "MessageEmbedChildResponse": {
- "type": "object",
- "properties": {
- "type": {
- "type": "string",
- "description": "The type of embed (e.g., rich, image, video, gifv, article, link)"
- },
- "url": {"description": "The URL of the embed", "nullable": true, "type": "string", "format": "uri"},
- "title": {"description": "The title of the embed", "nullable": true, "type": "string"},
- "color": {
- "description": "The color code of the embed sidebar",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
- },
- "timestamp": {
- "description": "The ISO 8601 timestamp of the embed content",
- "nullable": true,
- "type": "string",
- "format": "date-time",
- "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
- },
- "description": {"description": "The description of the embed", "nullable": true, "type": "string"},
- "author": {
- "description": "The author information of the embed",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedAuthorResponse"}]
- },
- "image": {
- "description": "The image of the embed",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
- },
- "thumbnail": {
- "description": "The thumbnail of the embed",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
- },
- "footer": {
- "description": "The footer of the embed",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedFooterResponse"}]
- },
- "fields": {
- "description": "The fields of the embed",
- "nullable": true,
- "type": "array",
- "items": {"$ref": "#/components/schemas/EmbedFieldResponse"}
- },
- "provider": {
- "description": "The provider of the embed (e.g., YouTube, Twitter)",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedProviderResponse"}]
- },
- "video": {
- "description": "The video of the embed",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
- },
- "audio": {
- "description": "The audio of the embed",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/EmbedMediaResponse"}]
- },
- "html": {
- "description": "Sanitized oEmbed HTML for trusted specialized embed renderers",
- "nullable": true,
- "type": "string"
- },
- "html_width": {
- "description": "The preferred width of sanitized oEmbed HTML",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
- },
- "html_height": {
- "description": "The preferred height of sanitized oEmbed HTML",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
- },
- "nsfw": {"description": "Whether the embed is flagged as NSFW", "nullable": true, "type": "boolean"}
- },
- "required": ["type"],
- "additionalProperties": false
- },
- "EmbedMediaResponse": {
- "type": "object",
- "properties": {
- "url": {"type": "string", "description": "The URL of the media"},
- "proxy_url": {
- "description": "The proxied URL of the media",
- "nullable": true,
- "type": "string",
- "format": "uri"
- },
- "content_type": {"description": "The MIME type of the media", "nullable": true, "type": "string"},
- "content_hash": {"description": "The hash of the media content", "nullable": true, "type": "string"},
- "width": {
- "description": "The width of the media in pixels",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
- },
- "height": {
- "description": "The height of the media in pixels",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
- },
- "description": {"description": "The description of the media", "nullable": true, "type": "string"},
- "placeholder": {
- "description": "The base64 encoded placeholder image for lazy loading",
- "nullable": true,
- "type": "string"
- },
- "duration": {
- "description": "The duration of the media in seconds",
- "nullable": true,
- "allOf": [{"$ref": "#/components/schemas/Int32Type"}]
- },
- "flags": {"allOf": [{"$ref": "#/components/schemas/EmbedMediaFlags"}]}
- },
- "required": ["url", "flags"],
- "additionalProperties": false
- },
- "EmbedProviderResponse": {
- "type": "object",
- "properties": {
- "name": {"type": "string", "description": "The name of the provider"},
- "url": {"description": "The URL of the provider", "nullable": true, "type": "string", "format": "uri"}
- },
- "required": ["name"],
- "additionalProperties": false
- },
- "EmbedFieldResponse": {
- "type": "object",
- "properties": {
- "name": {"type": "string", "description": "The name of the field"},
- "value": {"type": "string", "description": "The value of the field"},
- "inline": {"type": "boolean", "description": "Whether the field should be displayed inline"}
- },
- "required": ["name", "value", "inline"],
- "additionalProperties": false
- },
- "EmbedFooterResponse": {
- "type": "object",
- "properties": {
- "text": {"type": "string", "description": "The footer text"},
- "icon_url": {
- "description": "The URL of the footer icon",
- "nullable": true,
- "type": "string",
- "format": "uri"
- },
- "proxy_icon_url": {
- "description": "The proxied URL of the footer icon",
- "nullable": true,
- "type": "string",
- "format": "uri"
- }
- },
- "required": ["text"],
- "additionalProperties": false
- },
- "EmbedAuthorResponse": {
- "type": "object",
- "properties": {
- "name": {"type": "string", "description": "The name of the author"},
- "url": {"description": "The URL of the author", "nullable": true, "type": "string", "format": "uri"},
- "icon_url": {
- "description": "The URL of the author icon",
- "nullable": true,
- "type": "string",
- "format": "uri"
- },
- "proxy_icon_url": {
- "description": "The proxied URL of the author icon",
- "nullable": true,
- "type": "string",
- "format": "uri"
- }
- },
- "required": ["name"],
- "additionalProperties": false
- },
- "EmbedMediaFlags": {
- "type": "integer",
- "minimum": 0,
- "maximum": 2147483647,
- "description": "The bitwise flags for this media",
- "format": "int32",
- "x-bitflagValues": [
- {"name": "CONTAINS_EXPLICIT_MEDIA", "value": "16", "description": "Embed media contains explicit content"},
- {"name": "IS_ANIMATED", "value": "32", "description": "Embed media is animated"}
- ]
- },
"MessageAttachmentFlags": {
"type": "integer",
"minimum": 0,
diff --git a/fluxer_admin/src/templates/components/message_data.rs b/fluxer_admin/src/templates/components/message_data.rs
index b937f333f..ec0711e26 100644
--- a/fluxer_admin/src/templates/components/message_data.rs
+++ b/fluxer_admin/src/templates/components/message_data.rs
@@ -22,6 +22,26 @@ pub struct MissingAttachment {
pub size: Option<u64>,
}
+#[derive(Debug, PartialEq)]
+pub struct EmbedField {
+ pub name: String,
+ pub value: String,
+ pub inline: bool,
+}
+
+#[derive(Debug, PartialEq)]
+pub struct Embed {
+ pub title: Option<String>,
+ pub url: Option<String>,
+ pub description: Option<String>,
+ pub author_name: Option<String>,
+ pub fields: Vec<EmbedField>,
+ pub footer_text: Option<String>,
+ pub image_url: Option<String>,
+ pub thumbnail_url: Option<String>,
+ pub nsfw: bool,
+}
+
#[derive(Debug, PartialEq)]
pub struct Message {
pub id: String,
@@ -42,6 +62,7 @@ pub struct Message {
pub guild_nsfw: Option<bool>,
pub attachments: Vec<Attachment>,
pub missing_attachments: Vec<MissingAttachment>,
+ pub embeds: Vec<Embed>,
}
pub fn ordered_messages(values: &[Value]) -> Vec<Message> {
@@ -63,6 +84,12 @@ fn message_from_value(value: &Value) -> Message {
.flatten()
.map(missing_attachment_from_value)
.collect();
+ let embeds = value["embeds"]
+ .as_array()
+ .into_iter()
+ .flatten()
+ .map(embed_from_value)
+ .collect();
Message {
id: value_id(&value["id"]).unwrap_or_default(),
content: value["content"].as_str().unwrap_or("").to_owned(),
@@ -90,9 +117,44 @@ fn message_from_value(value: &Value) -> Message {
guild_nsfw: value["guild_nsfw"].as_bool(),
attachments,
missing_attachments,
+ embeds,
}
}
+fn embed_from_value(value: &Value) -> Embed {
+ Embed {
+ title: non_empty_str(&value["title"]),
+ url: non_empty_str(&value["url"]),
+ description: non_empty_str(&value["description"]),
+ author_name: non_empty_str(&value["author"]["name"]),
+ fields: value["fields"]
+ .as_array()
+ .into_iter()
+ .flatten()
+ .map(|field| EmbedField {
+ name: field["name"].as_str().unwrap_or("").to_owned(),
+ value: field["value"].as_str().unwrap_or("").to_owned(),
+ inline: field["inline"].as_bool().unwrap_or(false),
+ })
+ .collect(),
+ footer_text: non_empty_str(&value["footer"]["text"]),
+ image_url: embed_media_url(&value["image"]),
+ thumbnail_url: embed_media_url(&value["thumbnail"]),
+ nsfw: value["nsfw"].as_bool().unwrap_or(false),
+ }
+}
+
+fn embed_media_url(value: &Value) -> Option<String> {
+ non_empty_str(&value["proxy_url"]).or_else(|| non_empty_str(&value["url"]))
+}
+
+fn non_empty_str(value: &Value) -> Option<String> {
+ value
+ .as_str()
+ .filter(|s| !s.is_empty())
+ .map(ToOwned::to_owned)
+}
+
fn missing_attachment_from_value(value: &Value) -> MissingAttachment {
MissingAttachment {
id: value_id(&value["id"]).unwrap_or_default(),
@@ -129,3 +191,52 @@ fn compare_message_ids(left: &Message, right: &Message) -> Ordering {
_ => left.id.cmp(&right.id),
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use serde_json::json;
+
+ #[test]
+ fn embeds_are_read_from_the_admin_message() {
+ let messages = ordered_messages(&[json!({
+ "id": "200",
+ "content": "",
+ "webhook_id": "400",
+ "author_bot": true,
+ "embeds": [{
+ "type": "rich",
+ "title": "Deploy finished",
+ "description": "Build 42 is live",
+ "url": "https://example.com/builds/42",
+ "author": {"name": "CI"},
+ "fields": [{"name": "Region", "value": "eu-north", "inline": true}],
+ "footer": {"text": "CI pipeline"},
+ "image": {"url": "https://example.com/image.png", "proxy_url": "https://media.example.com/image.png"},
+ "thumbnail": {"url": "https://example.com/thumb.png"},
+ "nsfw": true
+ }]
+ })]);
+ let message = &messages[0];
+ assert_eq!(message.webhook_id.as_deref(), Some("400"));
+ assert_eq!(message.author_bot, Some(true));
+ assert_eq!(
+ message.embeds,
+ vec![Embed {
+ title: Some("Deploy finished".to_owned()),
+ url: Some("https://example.com/builds/42".to_owned()),
+ description: Some("Build 42 is live".to_owned()),
+ author_name: Some("CI".to_owned()),
+ fields: vec![EmbedField {
+ name: "Region".to_owned(),
+ value: "eu-north".to_owned(),
+ inline: true,
+ }],
+ footer_text: Some("CI pipeline".to_owned()),
+ image_url: Some("https://media.example.com/image.png".to_owned()),
+ thumbnail_url: Some("https://example.com/thumb.png".to_owned()),
+ nsfw: true,
+ }]
+ );
+ }
+}
diff --git a/fluxer_admin/src/templates/components/message_list.rs b/fluxer_admin/src/templates/components/message_list.rs
index b8196793b..c0a736ad9 100644
--- a/fluxer_admin/src/templates/components/message_list.rs
+++ b/fluxer_admin/src/templates/components/message_list.rs
@@ -11,7 +11,7 @@ use super::user_display::format_user_display;
use crate::config::AdminConfig;
use crate::utils::timestamps::format_admin_timestamp;
-use super::message_data::{Attachment, Message};
+use super::message_data::{Attachment, Embed, Message};
fn is_image(att: &Attachment) -> bool {
att.content_type
@@ -87,6 +87,106 @@ fn render_other_attachments(msg: &Message, has_content_or_images: bool) -> Marku
}
}
+fn safe_link(url: &str) -> Option<&str> {
+ (url.starts_with("https://") || url.starts_with("http://")).then_some(url)
+}
+
+fn render_embed_image(url: &str, alt: &str, class: &str) -> Markup {
+ match safe_link(url) {
+ Some(href) => html! {
+ a href=(href) target="_blank" rel="noopener noreferrer"
+ class="block overflow-hidden rounded bg-neutral-100" {
+ img src=(href) alt=(alt) loading="lazy"
+ class={(class) " scale-110 object-contain blur-2xl \
+ transition-[filter,transform] duration-150 \
+ hover:scale-100 hover:blur-none"};
+ }
+ },
+ None => html! {},
+ }
+}
+
+fn render_embed(embed: &Embed) -> Markup {
+ html! {
+ div class="max-w-xl rounded-lg border border-neutral-200 border-l-4 border-l-neutral-400 \
+ bg-neutral-50 p-3 text-sm"
+ data-message-embed="" {
+ div class="flex gap-3" {
+ div class="min-w-0 flex-1 space-y-1" {
+ @if let Some(author) = &embed.author_name {
+ div class="font-medium text-neutral-700 text-xs" { (author) }
+ }
+ @if let Some(title) = &embed.title {
+ @match embed.url.as_deref().and_then(safe_link) {
+ Some(href) => a href=(href) target="_blank" rel="noopener noreferrer"
+ class="block break-words font-semibold text-blue-600 hover:underline" {
+ (title)
+ },
+ None => div class="break-words font-semibold text-neutral-900" { (title) },
+ }
+ }
+ @if let Some(description) = &embed.description {
+ div class="whitespace-pre-wrap break-words text-neutral-800 leading-snug" {
+ (description)
+ }
+ }
+ @if !embed.fields.is_empty() {
+ div class="grid gap-2 pt-1" style="grid-template-columns:repeat(3,minmax(0,1fr));" {
+ @for field in &embed.fields {
+ @let span = if field.inline { "" } else { "grid-column:1/-1;" };
+ div class="min-w-0" style=(span) {
+ div class="break-words font-semibold text-neutral-900 text-xs" {
+ (field.name)
+ }
+ div class="whitespace-pre-wrap break-words text-neutral-700 text-xs" {
+ (field.value)
+ }
+ }
+ }
+ }
+ }
+ }
+ @if let Some(thumbnail) = &embed.thumbnail_url {
+ div class="flex-shrink-0" style="width:80px;" {
+ (render_embed_image(thumbnail, "Embed thumbnail", "block max-h-20 w-full"))
+ }
+ }
+ }
+ @if let Some(image) = &embed.image_url {
+ div class="mt-2" {
+ (render_embed_image(image, "Embed image", "block max-h-96 w-full"))
+ }
+ }
+ @if embed.footer_text.is_some() || embed.nsfw {
+ div class="mt-2 flex flex-wrap items-center gap-2 text-neutral-500 text-xs" {
+ @if let Some(footer) = &embed.footer_text {
+ span class="break-words" { (footer) }
+ }
+ (attachment_nsfw_badge(embed.nsfw))
+ }
+ }
+ }
+ }
+}
+
+fn render_embeds(msg: &Message) -> Markup {
+ if msg.embeds.is_empty() {
+ return html! {};
+ }
+ let spacer = if !msg.content.is_empty() || !msg.attachments.is_empty() {
+ "mt-2 space-y-2"
+ } else {
+ "mt-1 space-y-2"
+ };
+ html! {
+ div class=(spacer) {
+ @for embed in &msg.embeds {
+ (render_embed(embed))
+ }
+ }
+ }
+}
+
fn render_missing_attachments(msg: &Message) -> Markup {
if msg.missing_attachments.is_empty() {
return html! {};
@@ -192,6 +292,7 @@ fn message_row(
(render_image_attachments(msg, include_delete))
(render_other_attachments(msg, has_content_or_images))
}
+ (render_embeds(msg))
(render_missing_attachments(msg))
(meta)
@if include_delete && !has_images {
@@ -273,6 +374,7 @@ fn message_row(
(render_image_attachments(msg, include_delete))
(render_other_attachments(msg, has_content_or_images))
}
+ (render_embeds(msg))
(render_missing_attachments(msg))
(meta)
}
@@ -353,3 +455,77 @@ const MESSAGE_DELETE_PREFILL_SCRIPT: &str = r#"(function() {
form.querySelector('[name="basis"]').focus({preventScroll: true});
});
})();"#;
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use crate::config::ProxyConfig;
+ use crate::templates::components::message_data::ordered_messages;
+ use serde_json::json;
+
+ fn test_config() -> AdminConfig {
+ AdminConfig {
+ host: "127.0.0.1".to_owned(),
+ port: 3020,
+ secret_key_base: "secret".to_owned(),
+ base_path: String::new(),
+ api_endpoint: "https://api.example.com".to_owned(),
+ api_public_endpoint: "https://api.example.com".to_owned(),
+ media_endpoint: "https://media.example.com".to_owned(),
+ static_cdn_endpoint: "https://static.example.com".to_owned(),
+ reports_bucket_origin: "https://reports.example.com".to_owned(),
+ admin_endpoint: "https://admin.example.com".to_owned(),
+ web_app_endpoint: "https://app.example.com".to_owned(),
+ oauth_client_id: "1".to_owned(),
+ oauth_client_secret: "secret".to_owned(),
+ oauth_redirect_uri: "https://admin.example.com/oauth2_callback".to_owned(),
+ build_version: "test".to_owned(),
+ self_hosted: true,
+ proxy: ProxyConfig {
+ trust_client_ip_header: false,
+ client_ip_header_name: "x-forwarded-for".to_owned(),
+ },
+ }
+ }
+
+ #[test]
+ fn webhook_message_with_only_embeds_renders_the_embed() {
+ let values = vec![json!({
+ "id": "200",
+ "channel_id": "100",
+ "guild_id": "50",
+ "author_id": "300",
+ "author_username": "Status Bot",
+ "author_discriminator": "0000",
+ "author_avatar": null,
+ "author_global_name": null,
+ "author_bot": true,
+ "webhook_id": "400",
+ "content": "",
+ "timestamp": "2026-10-29T12:00:00.000Z",
+ "attachments": [],
+ "embeds": [{
+ "type": "rich",
+ "title": "Deploy finished",
+ "description": "Build 42 is live",
+ "url": "https://example.com/builds/42",
+ "fields": [{"name": "Region", "value": "eu-north", "inline": true}],
+ "footer": {"text": "CI pipeline"},
+ "image": {"url": "https://media.example.com/image.png"},
+ "thumbnail": {"url": "https://media.example.com/thumb.png"}
+ }]
+ })];
+ let messages = ordered_messages(&values);
+ let html = message_list(&test_config(), "", &messages, true, None, None).into_string();
+ assert!(html.contains("data-message-webhook=\"400\""));
+ assert!(html.contains("data-message-embed"));
+ assert!(html.contains("Deploy finished"));
+ assert!(html.contains("https://example.com/builds/42"));
+ assert!(html.contains("Build 42 is live"));
+ assert!(html.contains("Region"));
+ assert!(html.contains("eu-north"));
+ assert!(html.contains("CI pipeline"));
+ assert!(html.contains("https://media.example.com/image.png"));
+ assert!(html.contains("https://media.example.com/thumb.png"));
+ }
+}
diff --git a/fluxer_api/src/api/admin/services/AdminMessageService.ts b/fluxer_api/src/api/admin/services/AdminMessageService.ts
index 6e8815b22..531049a82 100644
--- a/fluxer_api/src/api/admin/services/AdminMessageService.ts
+++ b/fluxer_api/src/api/admin/services/AdminMessageService.ts
@@ -262,6 +262,8 @@ export class AdminMessageService {
author_global_name: message.author.global_name ?? null,
author_discriminator: message.author.discriminator,
author_avatar: message.author.avatar,
+ author_bot: message.author.bot ?? false,
+ webhook_id: message.webhook_id ?? null,
content: message.content ?? '',
timestamp: message.timestamp,
attachments:
@@ -275,6 +277,7 @@ export class AdminMessageService {
height: attachment.height ?? null,
size: attachment.size == null ? null : assertSafeByteSize(attachment.size, 'admin message attachment size'),
})) ?? [],
+ embeds: message.embeds ?? [],
};
}
diff --git a/fluxer_api/src/api/admin/tests/AdminMessageEmbeds.test.ts b/fluxer_api/src/api/admin/tests/AdminMessageEmbeds.test.ts
new file mode 100644
index 000000000..fb3c56f3a
--- /dev/null
+++ b/fluxer_api/src/api/admin/tests/AdminMessageEmbeds.test.ts
@@ -0,0 +1,67 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createTestAccount, setUserACLs} from '@app/api/auth/tests/AuthTestUtils';
+import {createGuild} from '@app/api/guild/tests/GuildTestUtils';
+import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
+import {createBuilder, createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
+import {createWebhook} from '@app/api/webhook/tests/WebhookTestUtils';
+import {AdminACLs} from '@fluxer/constants/src/AdminACLs';
+import type {LookupMessageResponse} from '@fluxer/schema/src/domains/admin/AdminSchemas';
+import type {MessageResponse} from '@fluxer/schema/src/domains/message/MessageResponseSchemas';
+import {afterAll, beforeAll, describe, expect, it} from 'vitest';
+import type {z} from 'zod';
+
+describe('Admin message embeds', () => {
+ let harness: ApiTestHarness;
+ beforeAll(async () => {
+ harness = await createApiTestHarness();
+ });
+ afterAll(async () => {
+ await harness?.shutdown();
+ });
+ it('returns embeds and webhook details for a webhook message with only embeds', async () => {
+ const owner = await createTestAccount(harness);
+ const guild = await createGuild(harness, owner.token, 'Admin Embeds Guild');
+ const channelId = guild.system_channel_id!;
+ const webhook = await createWebhook(harness, channelId, owner.token, 'Embed Hook');
+ const message = await createBuilderWithoutAuth<MessageResponse>(harness)
+ .post(`/webhooks/${webhook.id}/${webhook.token}?wait=true`)
+ .body({
+ username: 'Status Bot',
+ embeds: [
+ {
+ title: 'Deploy finished',
+ description: 'Build 42 is live',
+ url: 'https://example.com/builds/42',
+ fields: [{name: 'Region', value: 'eu-north', inline: true}],
+ footer: {text: 'CI pipeline'},
+ image: {url: 'https://example.com/image.png'},
+ thumbnail: {url: 'https://example.com/thumb.png'},
+ },
+ ],
+ })
+ .expect(200)
+ .execute();
+ const admin = await setUserACLs(harness, await createTestAccount(harness), [
+ AdminACLs.AUTHENTICATE,
+ AdminACLs.MESSAGE_LOOKUP,
+ ]);
+ const result = await createBuilder<z.infer<typeof LookupMessageResponse>>(harness, admin.token)
+ .get(`/admin/channels/${channelId}/messages/${message.id}?context_limit=1`)
+ .expect(200)
+ .execute();
+ const adminMessage = result.messages.find((entry) => entry.id === message.id);
+ expect(adminMessage).toBeDefined();
+ expect(adminMessage!.content).toBe('');
+ const embed = adminMessage!.embeds?.[0];
+ expect(embed?.title).toBe('Deploy finished');
+ expect(embed?.description).toBe('Build 42 is live');
+ expect(embed?.url).toBe('https://example.com/builds/42');
+ expect(embed?.fields?.[0]).toMatchObject({name: 'Region', value: 'eu-north', inline: true});
+ expect(embed?.footer?.text).toBe('CI pipeline');
+ expect(embed?.image?.url).toBeTruthy();
+ expect(embed?.thumbnail?.url).toBeTruthy();
+ expect(adminMessage!.webhook_id).toBe(webhook.id);
+ expect(adminMessage!.author_bot).toBe(true);
+ });
+});
diff --git a/fluxer_docs/src/content/docs/admin-api/messages.mdx b/fluxer_docs/src/content/docs/admin-api/messages.mdx
index 895c7cd5e..a04e4cbeb 100644
--- a/fluxer_docs/src/content/docs/admin-api/messages.mdx
+++ b/fluxer_docs/src/content/docs/admin-api/messages.mdx
@@ -33,9 +33,12 @@ One message with its author, content, attachments and the NSFW settings of its c
| author_global_name | ?string | The author display name, or null when unset |
| author_discriminator | string | The author discriminator tag (1-10 characters) |
| author_avatar | ?string | The author avatar hash, or null when unset |
+| author_bot? | boolean | Whether the author is a bot |
+| webhook_id? | ?snowflake | The ID of the webhook that sent the message, or null when a user sent it |
| content | string | The message content (0-4,000 characters) |
| timestamp | ISO8601 timestamp | When the message was sent |
| attachments | array[[Admin message attachment](#admin-message-attachment-object) object] | The attachments of the message (at most 10) |
+| embeds? | array[[embed](/http-api/messages/#embed-object) object] | The embeds of the message |
<sup>1</sup> These come from the channel in the request and are the same on every object in one response. All are null when the channel no longer exists
diff --git a/packages/schema/src/domains/admin/AdminSchemas.ts b/packages/schema/src/domains/admin/AdminSchemas.ts
index 10b93b02b..25dd47277 100644
--- a/packages/schema/src/domains/admin/AdminSchemas.ts
+++ b/packages/schema/src/domains/admin/AdminSchemas.ts
@@ -61,6 +61,7 @@ import {
InstanceRegistrationModeSchema,
TagStyleSchema,
} from '@fluxer/schema/src/domains/instance/InstanceSchemas';
+import {MessageEmbedResponse} from '@fluxer/schema/src/domains/message/EmbedSchemas';
import {MessageResponseSchema} from '@fluxer/schema/src/domains/message/MessageResponseSchemas';
import {ChannelTypeSchema} from '@fluxer/schema/src/primitives/ChannelValidators';
import {
@@ -1648,9 +1649,12 @@ export const AdminMessageSchema = z.object({
author_global_name: z.string().nullable(),
author_discriminator: createStringType(1, 10),
author_avatar: z.string().nullable(),
+ author_bot: z.boolean().optional(),
+ webhook_id: SnowflakeStringType.nullable().optional(),
content: createStringType(0, 4000),
timestamp: z.string(),
attachments: z.array(AdminMessageAttachmentSchema).max(10),
+ embeds: z.array(MessageEmbedResponse).optional(),
});
export const LookupMessageResponse = z.object({
messages: z.array(AdminMessageSchema).max(100),