Closed KubaZ2 closed 2 weeks ago
What I think could be done is MessageProperties
as a base for all messages. It would contain only fields used for all message types across Discord. I think we could add:
ChannelMessageProperties
- would be used for the legacy message endpointReplyMessageProperties
- ChannelMessageProperties
but with automatic reply, used in RestMessage.ReplyAsync
ForumGuildThreadMessageProperties
- for messages opening forum postsInteractionMessageProperties
- for interaction responsesWebhookMessageProperties
- for webhook messagesHaving MessageProperties
as the default type rather than an interface would allow for using new()
for creating an instance while allowing for generic APIs building messages unless they would like to use some unique message specific property.
I am open to any comments/questions.
Actually, I think accepting MessageProperties
type for most methods would cause confusion. Maybe a better idea is to create IMessageProperties
interface that will contain properties common for all message properties.
Description
I have seen some confusion with message sending. It was caused by endpoints having their own unique message types.
It causes problems when trying to creating a generic API for many endpoints, for example for both channel messages and interaction responses.
This issue exists so that the pros and cons of generic message types and possible solutions can be collected.