Merge branch 'feature/v4-creds.yml-location' into 'v4'

NEW: add NadekoBot__creds env to specify alternative creds.yml

See merge request Kwoth/nadekobot!257
This commit is contained in:
Kwoth
2022-07-27 05:00:28 +00:00
5 changed files with 39 additions and 20 deletions

View File

@@ -35,13 +35,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);