NEW: add NadekoBot__creds env to specify alternative creds.yml

This commit is contained in:
Veovis
2022-07-27 05:00:27 +00:00
committed by Kwoth
parent f761714f15
commit cc6128997e
5 changed files with 39 additions and 20 deletions

View File

@@ -34,13 +34,13 @@ public sealed class Bot
private readonly IBotCredsProvider _credsProvider;
// private readonly InteractionService _interactionService;
public Bot(int shardId, int? totalShards)
public Bot(int shardId, int? totalShards, string credPath = null)
{
if (shardId < 0)
throw new ArgumentOutOfRangeException(nameof(shardId));
ShardId = shardId;
_credsProvider = new BotCredsProvider(totalShards);
_credsProvider = new BotCredsProvider(totalShards, credPath);
_creds = _credsProvider.GetCreds();
_db = new(_credsProvider);