Skip to content

embeds field in messages endpoint can be null on discord but not spacebar #1557

@gizmogoat

Description

@gizmogoat

Describe the bug
When sending messages, the field "embeds" is allowed to be null on Discord's real API, but not on Spacebar's.

To Reproduce
Steps to reproduce the behavior:

  1. Send an HTTP request to the channels/id/messages endpoint through a bot with a null embeds field.

Expected behavior
Spacebar API is unbothered by "embeds": null like real API

Console Logs
[0006] ERROR gateway: SendMessage failed: HTTP 400 Bad Request, {"code":50035,"message":"Invalid Form Body","errors":{"embeds":{"_errors":[{"message":"must be array","code":"type"}]}},"_ajvErrors":[{"instancePath":"/embeds","schemaPath":"#/properties/embeds/type","keyword":"type","params":{"type":"array"},"message":"must be array"}],"request":"POST /api/v9/channels/1475017016980037677/messages"}

Image Image

The two requests above are sent via Matterbridge and a simple mitmproxy script to reroute to different destinations based on the token length. They both have the same request body.

System Information (please complete the following information):

OS: Ubuntu
Version (If not applicable skip): 24.04
Node Version: 24.13.1
Python 3 Version: Python 3.13.12

Env and Software info

Release: nightly
Branch (if release is not applicable): master
Commit Hash (if release is not applicable): https://github.com/spacebarchat/server/commit/785f53e7d1f485941e47f13f4558f9568571f9b0
Database: 16.11
Reverse Proxy: cloudflared
Thread Count: default

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions