Services.Add now returns the object passed to it
This commit is contained in:
@@ -15,11 +15,12 @@ namespace Discord
|
|||||||
_services = new Dictionary<Type, IService>();
|
_services = new Dictionary<Type, IService>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Add<T>(T service)
|
public T Add<T>(T service)
|
||||||
where T : class, IService
|
where T : class, IService
|
||||||
{
|
{
|
||||||
_services.Add(typeof(T), service);
|
_services.Add(typeof(T), service);
|
||||||
service.Install(Client);
|
service.Install(Client);
|
||||||
|
return service;
|
||||||
}
|
}
|
||||||
|
|
||||||
public T Get<T>(bool isRequired = true)
|
public T Get<T>(bool isRequired = true)
|
||||||
|
|||||||
Reference in New Issue
Block a user