Open bitfl0wer opened 1 year ago
I thought this was a legacy thing but I can't find anything about it in the discord docs history so idk.
I'm pretty sure the discord.com client does send message type in this endpoint, but the default type is just a normal message which is used when it's undef.
Edit: newer clients may or may not, I haven't checked.
I'm pretty sure the discord.com client does send message type in this endpoint, but the default type is just a normal message which is used when it's undef.
Edit: newer clients may or may not, I haven't checked.
It would seem that they don't: This is the request body for sending a message via the official Web Client
https://github.com/spacebarchat/server/blob/master/src/api/routes/channels/%23channel_id/messages/index.ts#L299-L309 https://github.com/spacebarchat/server/blob/master/src/util/schemas/MessageCreateSchema.ts#L26-L27
it's optional in our impl, so I guess it's fine. Weird that the docs don't display that, though. I suppose if it's not sent ever, we could remove it, but I still think it is sent at some point. Perhaps for message references ( type is set to reply ). Idk
https://github.com/spacebarchat/server/blob/master/src/api/routes/channels/%23channel_id/messages/index.ts#L299-L309 https://github.com/spacebarchat/server/blob/master/src/util/schemas/MessageCreateSchema.ts#L26-L27
it's optional in our impl, so I guess it's fine. Weird that the docs don't display that, though. I suppose if it's not sent ever, we could remove it, but I still think it is sent at some point. Perhaps for message references ( type is set to reply ). Idk
nah, its just message_reference
, that is used to make it a reply.
is that showing the post fields only or the entire Message schema?
Theory: doesn't newer versions of the Discord API express message type via flags?
It seems that embed
is a deprecated field (in favor of embeds
), which is why it isn't documented in the discord docs
(source)
Also, the message type is included in the message object, but not in the create message parameters. Looks like the message type is inferred server side, used for more than just usual "messages" (CALL
, RECIPIENT_ADD
, USER_JOIN
, etc. used for other endpoints / actions; REPLY
created by sending message_reference
in create message)
Theory: doesn't newer versions of the Discord API express message type via flags?
Seems like flags are a whole separate thing, they are sent along with the type in a full message object and by themselves when creating a message
Two small things:
type
:integer
parameter, presumably for the message type. However, the Discord API docs do not mention such a value in the message creation context. Is this an issue of the Discord Docs being incomplete, or are the Spacebar Docs wrong?embed
:object
andembeds
:array of object
as possible values in message creation. Again: Discord API being incomplete, or Spacebar Docs being wrong/outdated?That's all :)