public nadeko stuff
This commit is contained in:
@ -10,6 +10,7 @@ using NadekoBot.Extensions;
|
||||
using NadekoBot.Core.Services;
|
||||
using NadekoBot.Core.Services.Impl;
|
||||
using NLog;
|
||||
using StackExchange.Redis;
|
||||
|
||||
namespace NadekoBot.Modules.Administration.Services
|
||||
{
|
||||
@ -17,7 +18,8 @@ namespace NadekoBot.Modules.Administration.Services
|
||||
{
|
||||
public bool ForwardDMs => _bc.BotConfig.ForwardMessages;
|
||||
public bool ForwardDMsToAllOwners => _bc.BotConfig.ForwardToAllOwners;
|
||||
|
||||
|
||||
private readonly ConnectionMultiplexer _redis;
|
||||
private readonly NadekoBot _bot;
|
||||
private readonly CommandHandler _cmdHandler;
|
||||
private readonly DbService _db;
|
||||
@ -28,10 +30,13 @@ namespace NadekoBot.Modules.Administration.Services
|
||||
private readonly IBotCredentials _creds;
|
||||
private ImmutableArray<AsyncLazy<IDMChannel>> ownerChannels = new ImmutableArray<AsyncLazy<IDMChannel>>();
|
||||
private readonly IBotConfigProvider _bc;
|
||||
private readonly IImagesService _imgs;
|
||||
|
||||
public SelfService(DiscordSocketClient client, NadekoBot bot, CommandHandler cmdHandler, DbService db,
|
||||
IBotConfigProvider bc, ILocalization localization, NadekoStrings strings, IBotCredentials creds)
|
||||
IBotConfigProvider bc, ILocalization localization, NadekoStrings strings, IBotCredentials creds,
|
||||
IDataCache cache, IImagesService imgs)
|
||||
{
|
||||
_redis = cache.Redis;
|
||||
_bot = bot;
|
||||
_cmdHandler = cmdHandler;
|
||||
_db = db;
|
||||
@ -41,6 +46,11 @@ namespace NadekoBot.Modules.Administration.Services
|
||||
_client = client;
|
||||
_creds = creds;
|
||||
_bc = bc;
|
||||
_imgs = imgs;
|
||||
|
||||
var sub = _redis.GetSubscriber();
|
||||
sub.Subscribe(_creds.RedisKey() + "_reload_images",
|
||||
delegate { _imgs.Reload(); }, CommandFlags.FireAndForget);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
|
Reference in New Issue
Block a user