discord-api-docs icon indicating copy to clipboard operation
discord-api-docs copied to clipboard

`banner` and `accent_color` are always `null` on a message author via REST

Open Jiralite opened this issue 1 year ago • 10 comments

Description

banner and accent_color are returned for the message author when fetching a message. These properties always seem to be null.

Steps to Reproduce

  1. Find a message whose author has either a profile banner or a profile theme set
  2. Run the following replacing channel_id with a channel id and message_id with a message id:
    curl 'https://discord.com/api/v10/channels/channel_id/messages/message_id' \
    --request GET \
    --header 'Authorization: Bot <token>'
    

Expected Behavior

The fields should be populated correctly. Perhaps they should even be omitted per https://github.com/discord/discord-api-docs/issues/3898#issuecomment-947900146.

Current Behavior

Both fields are always null.

Screenshots/Videos

No response

Client and System Information

curl 8.4.0 (x86_64-apple-darwin23.0) libcurl/8.4.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.58.0

Jiralite avatar May 13 '24 19:05 Jiralite

The fields will not be present when null in the next API deploy

yonilerner avatar May 14 '24 22:05 yonilerner

Actually it turned out changing this was more trouble than I thought. Its not really a bug though, so Im just gonna leave it as-is

yonilerner avatar May 14 '24 22:05 yonilerner

Its not really a bug though, so Im just gonna leave it as-is

For clarity, are you saying that when a user has a banner and Discord says they do not, that is intended behaviour?

Jiralite avatar May 14 '24 22:05 Jiralite

Its intended behavior that this API does not return the banner information

yonilerner avatar May 14 '24 23:05 yonilerner

incorrect null responses cause issues for libraries since their user processing would see that the field is null and then update the cached user object to change the field to null, assuming that the user's banner has been removed

advaith1 avatar May 14 '24 23:05 advaith1

Is this affecting anyone in practice? IMO API requests shouldn't be updating stateful models, that's what the gateway events are for

yonilerner avatar May 14 '24 23:05 yonilerner

API requests should have the most up to date state as much as possible, so it just makes sense to have this properly populated.

Rapptz avatar May 14 '24 23:05 Rapptz

Is this affecting anyone in practice? IMO API requests shouldn't be updating stateful models, that's what the gateway events are for

This would be a reasonable way to go about this. If there actually was any gateway event that had the banner and accentColor properties this is about. But there isn’t. So API requests are the only way to update the state of them. If you instead implement a gateway event to send these on change I‘d be very happy to not change the data based on the API requests.

Qjuh avatar May 15 '24 14:05 Qjuh

Alright thanks for convincing me

yonilerner avatar May 15 '24 17:05 yonilerner

Any updates on this?

BlyZeDev avatar Dec 18 '24 12:12 BlyZeDev