Previously in v0.33.0, InteractionResponse.Data could be nil, which worked for interaction response types InteractionCallbackUpdateMessage and InteractionCallbackDeferredUpdateMessage, which do not need to send data to discord in the interaction response; however, interaction responses that actually created messages with files were not supported.
In v0.34.0, that was alleviated; however now, CreateInteractionResponse.Data must not be nil in order for CreateInteractionResponse.prepare() to function properly, so this broke for interaction responses that don't need to send data. I added a section to CreateInteractionResponse.prepare() that returns the data necessary for CreateInteractionResponse.Data == nil to work for interaction types as before.
Edit: Apparently, I misunderstood how the CreateInteractionResponse.Data gets used by discord for interaction response types InteractionCallbackUpdateMessage and InteractionCallbackDeferredUpdateMessage (i.e. me definitely overthinking it). However, I still think it makes sense to allow CreateInteractionResponse.Data to be nil when being sent since that conforms more with discord's docs.
If you take a look at the discord documentation on the interaction response structure, data is optional, so I think it makes sense if support for CreateInteractionResponse.Data being nil continues.
Breaking Change?
no
Benchmarks
Checklist:
[x] I have performed a self-review of my own code
[ ] Commented complex situations or referenced the discord documentation
[ ] Updated documentation
[ ] Added/Updated unit tests
[ ] Added/Updated benchmarks (if this is a performance critical component)
Description
Previously in v0.33.0,InteractionResponse.Data
could benil
, which worked for interaction response typesInteractionCallbackUpdateMessage
andInteractionCallbackDeferredUpdateMessage
, which do not need to send data to discord in the interaction response; however, interaction responses that actually created messages with files were not supported.In v0.34.0, that was alleviated; however now,CreateInteractionResponse.Data
must not benil
in order forCreateInteractionResponse.prepare()
to function properly, so this broke for interaction responses that don't need to send data. I added a section toCreateInteractionResponse.prepare()
that returns the data necessary forCreateInteractionResponse.Data == nil
to work for interaction types as before.Edit: Apparently, I misunderstood how the
CreateInteractionResponse.Data
gets used by discord for interaction response typesInteractionCallbackUpdateMessage
andInteractionCallbackDeferredUpdateMessage
(i.e. me definitely overthinking it). However, I still think it makes sense to allowCreateInteractionResponse.Data
to benil
when being sent since that conforms more with discord's docs.If you take a look at the discord documentation on the interaction response structure, data is optional, so I think it makes sense if support for
CreateInteractionResponse.Data
beingnil
continues.Breaking Change?
no
Benchmarks
Checklist: