Cleanup, .clparew can now be ran everyone, modules load appropriate guild configs, IEnumerable<GuildConfig> replaces with NadekoBot.AllGuildConfigs

This commit is contained in:
Master Kwoth
2017-10-13 02:21:39 +02:00
parent db6fa9af1a
commit e32446335e
40 changed files with 336 additions and 180 deletions

View File

@ -51,7 +51,9 @@ namespace NadekoBot.Services
public ConcurrentHashSet<ulong> UsersOnShortCooldown { get; } = new ConcurrentHashSet<ulong>();
private readonly Timer _clearUsersOnShortCooldown;
public CommandHandler(DiscordSocketClient client, DbService db, IBotConfigProvider bc, IEnumerable<GuildConfig> gcs, CommandService commandService, IBotCredentials credentials, NadekoBot bot)
public CommandHandler(DiscordSocketClient client, DbService db,
IBotConfigProvider bc, CommandService commandService,
IBotCredentials credentials, NadekoBot bot)
{
_client = client;
_commandService = commandService;
@ -67,7 +69,7 @@ namespace NadekoBot.Services
}, null, GlobalCommandsCooldown, GlobalCommandsCooldown);
DefaultPrefix = bc.BotConfig.DefaultPrefix;
_prefixes = gcs
_prefixes = bot.AllGuildConfigs
.Where(x => x.Prefix != null)
.ToDictionary(x => x.GuildId, x => x.Prefix)
.ToConcurrent();