-
Notifications
You must be signed in to change notification settings - Fork 626
Description
At the moment, serenity has lots of similar structs that are fully separate from another, e.g. CreateMessage and CreateInteractionResponse. (Similar things apply for e.g. all the who-when-where stuff in e.g. CommandInteraction, Message, and ComponentInteraction.) These have very similar applications and very similar methods in them, but when making a bot that can respond both to messages, buttons, and commands, i had to adapt them using an enum. It would've been much nicer to just have a trait for this that is dyn-compatible.
For this to work however, the builders need to be changed to work with (&mut self, ...) -> ()
style functions instead of (self, ...) -> Self
, as otherwise the dyn compatibility is lost. This pattern makes writing highly modular bots much easier in general.
Is this planned, or even possible to do given the existing code, or would this require a hard fork?