mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Fixed playing rotate nullref
This commit is contained in:
@@ -11,6 +11,7 @@ public sealed class PlayingRotateService : INService, IReadyExecutor
|
|||||||
private readonly SelfService _selfService;
|
private readonly SelfService _selfService;
|
||||||
private readonly Replacer _rep;
|
private readonly Replacer _rep;
|
||||||
private readonly DbService _db;
|
private readonly DbService _db;
|
||||||
|
private readonly DiscordSocketClient _client;
|
||||||
|
|
||||||
public PlayingRotateService(
|
public PlayingRotateService(
|
||||||
DiscordSocketClient client,
|
DiscordSocketClient client,
|
||||||
@@ -22,6 +23,7 @@ public sealed class PlayingRotateService : INService, IReadyExecutor
|
|||||||
_db = db;
|
_db = db;
|
||||||
_bss = bss;
|
_bss = bss;
|
||||||
_selfService = selfService;
|
_selfService = selfService;
|
||||||
|
_client = client;
|
||||||
|
|
||||||
if (client.ShardId == 0)
|
if (client.ShardId == 0)
|
||||||
_rep = new ReplacementBuilder().WithClient(client).WithProviders(phProviders).Build();
|
_rep = new ReplacementBuilder().WithClient(client).WithProviders(phProviders).Build();
|
||||||
@@ -29,6 +31,9 @@ public sealed class PlayingRotateService : INService, IReadyExecutor
|
|||||||
|
|
||||||
public async Task OnReadyAsync()
|
public async Task OnReadyAsync()
|
||||||
{
|
{
|
||||||
|
if (_client.ShardId != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
using var timer = new PeriodicTimer(TimeSpan.FromMinutes(1));
|
using var timer = new PeriodicTimer(TimeSpan.FromMinutes(1));
|
||||||
var index = 0;
|
var index = 0;
|
||||||
while (await timer.WaitForNextTickAsync())
|
while (await timer.WaitForNextTickAsync())
|
||||||
|
Reference in New Issue
Block a user