Closed ikegami closed 1 week ago
Without the change to the library, this can be achieved using this word salad:
builder.ConfigureEventHandlers(
ehb =>
{
// The loop below performs the following for each module without hardcoding the type:
// ehb.AddEventHandlers<...>(ServiceLifetime.Singleton);
var method = ehb.GetType().GetMethod(nameof(EventHandlingBuilder.AddEventHandlers));
foreach (var event_handler_module in event_handler_modules)
method.MakeGenericMethod(event_handler_module).Invoke(ehb, [ServiceLifetime.Singleton]);
}
);
Thanks :)
Description
In EventHandlingBuilder, we have
I request the addition of an alternative interface:
This would allow the following:
It's a almost trivial addition.
Specify the libraries you want this feature request to affect
DSharpPlus, the core library
Other considerations
No response