mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 18:28:27 -04:00
- small bot.cs cleanup
- creds.yml now loads and reloads properly (from the current directory, like credentials.json) - added empty creds.yml to repo, and added it to .gitignore
This commit is contained in:
@@ -5,6 +5,8 @@ using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using Discord;
|
||||
using Discord.WebSocket;
|
||||
|
||||
namespace NadekoBot.Services
|
||||
{
|
||||
@@ -18,14 +20,12 @@ namespace NadekoBot.Services
|
||||
private readonly string _redisKey;
|
||||
private readonly EndPoint _redisEndpoint;
|
||||
|
||||
public RedisCache(IBotCredentials creds, int shardId)
|
||||
public RedisCache(ConnectionMultiplexer redis, IBotCredentials creds, DiscordSocketClient client)
|
||||
{
|
||||
var conf = ConfigurationOptions.Parse(creds.RedisOptions);
|
||||
|
||||
Redis = ConnectionMultiplexer.Connect(conf);
|
||||
Redis = redis;
|
||||
_redisEndpoint = Redis.GetEndPoints().First();
|
||||
LocalImages = new RedisImagesCache(Redis, creds);
|
||||
LocalData = new RedisLocalDataCache(Redis, creds, shardId);
|
||||
LocalData = new RedisLocalDataCache(Redis, creds, client.ShardId);
|
||||
_redisKey = creds.RedisKey();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user