andersfylling / disgord

Go module for interacting with the documented Discord's bot interface; Gateway, REST requests and voice
BSD 3-Clause "New" or "Revised" License
502 stars 71 forks source link

style: interaction data #503

Closed beachasaurus-rex closed 2 months ago

beachasaurus-rex commented 1 year ago

Description

Changing the interaction data types so that they're more aligned with discord's API. The main goal of this refactoring is to help disgord users express what is actually happening during interactions. In other words, if the user intends to receive an interaction object message component, then the user should receive the equivalent from disgord.

Interaction data is polymorphic, so this PR shows 1 way to achieve that a bit better in disgord.

[Interaction callback data]() is also polymorphic, so this PR shows 1 way to achieve that a bit better in disgord.

Breaking Change?

yes

Benchmarks

Checklist:

beachasaurus-rex commented 1 year ago

I know that a good chunk of the internal stuff would need to change for this to even work, but I want to get feedback on at least the surface-level API changes I've made so far.