This commit is contained in:
Master Kwoth 2017-10-09 02:59:00 +02:00
parent a12702fb68
commit 3d3871f903
2 changed files with 2 additions and 12 deletions

View File

@ -145,22 +145,13 @@ namespace NadekoBot
.AddManual<NadekoBot>(this)
.AddManual<IUnitOfWork>(uow)
.AddManual<IDataCache>(new RedisCache(Client.CurrentUser.Id));
Services.LoadFrom(Assembly.GetAssembly(typeof(CommandHandler)));
var commandHandler = Services.GetService<CommandHandler>();
commandHandler.AddServices(Services);
LoadTypeReaders(typeof(NadekoBot).Assembly);
//setup typereaders
CommandService.AddTypeReader<PermissionAction>(new PermissionActionTypeReader(Client, CommandService));
CommandService.AddTypeReader<CommandInfo>(new CommandTypeReader(Client, CommandService));
//todo module dependency
CommandService.AddTypeReader<CommandOrCrInfo>(new CommandOrCrTypeReader(Client, CommandService));
CommandService.AddTypeReader<ModuleInfo>(new ModuleTypeReader(Client, CommandService));
CommandService.AddTypeReader<ModuleOrCrInfo>(new ModuleOrCrTypeReader(Client, CommandService));
CommandService.AddTypeReader<IGuild>(new GuildTypeReader(Client, CommandService));
//CommandService.AddTypeReader<GuildDateTime>(new GuildDateTimeTypeReader());
}
Services.Unload(typeof(IUnitOfWork)); // unload it after the startup
}

View File

@ -42,8 +42,7 @@ namespace NadekoBot.Modules.Searches.Services
public List<MagicItem> MagicItems { get; } = new List<MagicItem>();
private readonly ConcurrentDictionary<ulong, SearchImageCacher> _imageCacher = new ConcurrentDictionary<ulong, SearchImageCacher>();
//todo clear when module unloaded
public ConcurrentDictionary<ulong, Timer> AutoHentaiTimers { get; } = new ConcurrentDictionary<ulong, Timer>();
public ConcurrentDictionary<ulong, Timer> AutoBoobTimers { get; } = new ConcurrentDictionary<ulong, Timer>();
public ConcurrentDictionary<ulong, Timer> AutoButtTimers { get; } = new ConcurrentDictionary<ulong, Timer>();