diff --git a/Hosting/NetCord.Hosting/Gateway/GatewayHandlerServiceCollectionExtensions.cs b/Hosting/NetCord.Hosting/Gateway/GatewayHandlerServiceCollectionExtensions.cs index 2d810da1..095e2241 100644 --- a/Hosting/NetCord.Hosting/Gateway/GatewayHandlerServiceCollectionExtensions.cs +++ b/Hosting/NetCord.Hosting/Gateway/GatewayHandlerServiceCollectionExtensions.cs @@ -32,6 +32,18 @@ public static IServiceCollection AddGatewayHandler(this IServiceCollection se return services; } + /// + /// Adds an to the specified . + /// + /// The to add the to. + /// The type of the to add. + /// A reference to this instance after the operation has completed. + public static IServiceCollection AddGatewayHandler(this IServiceCollection services, [DAM(DAMT.PublicConstructors)] Type handlerType) + { + services.AddSingleton(typeof(IGatewayHandler), handlerType); + return services; + } + /// /// Adds an to the specified . /// @@ -97,6 +109,18 @@ public static IServiceCollection AddShardedGatewayHandler(this IServiceCollec return services; } + /// + /// Adds an to the specified . + /// + /// The to add the to. + /// The type of the to add. + /// A reference to this instance after the operation has completed. + public static IServiceCollection AddShardedGatewayHandler(this IServiceCollection services, [DAM(DAMT.PublicConstructors)] Type handlerType) + { + services.AddSingleton(typeof(IShardedGatewayHandler), handlerType); + return services; + } + /// /// Adds an to the specified . ///