fixed .ropl probably

This commit is contained in:
Toastie 2025-03-15 11:48:55 +13:00
parent fbb9064434
commit d5eb3b57a0
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7

View file

@ -84,7 +84,8 @@ public sealed class BotActivityService : IBotActivityService, IReadyExecutor, IE
{ {
Name = game, Name = game,
Link = null, Link = null,
Type = type Type = type,
Disable = true
}); });
public Task SetStreamAsync(string name, string link) public Task SetStreamAsync(string name, string link)
@ -93,7 +94,8 @@ public sealed class BotActivityService : IBotActivityService, IReadyExecutor, IE
{ {
Name = name, Name = name,
Link = link, Link = link,
Type = ActivityType.Streaming Type = ActivityType.Streaming,
Disable = true
}); });
private sealed class ActivityPubData private sealed class ActivityPubData
@ -101,6 +103,7 @@ public sealed class BotActivityService : IBotActivityService, IReadyExecutor, IE
public string Name { get; init; } public string Name { get; init; }
public string Link { get; init; } public string Link { get; init; }
public ActivityType? Type { get; init; } public ActivityType? Type { get; init; }
public bool Disable { get; init; }
} }
public async Task OnReadyAsync() public async Task OnReadyAsync()
@ -108,7 +111,7 @@ public sealed class BotActivityService : IBotActivityService, IReadyExecutor, IE
await _pubSub.Sub(_activitySetKey, await _pubSub.Sub(_activitySetKey,
async data => async data =>
{ {
if (_client.ShardId == 0) if (_client.ShardId == 0 && data.Disable)
{ {
DisableRotatePlaying(); DisableRotatePlaying();
} }
@ -156,11 +159,19 @@ public sealed class BotActivityService : IBotActivityService, IReadyExecutor, IE
: rotatingStatuses[index++]; : rotatingStatuses[index++];
var statusText = await _rep.ReplaceAsync(playingStatus.Status, new(client: _client)); var statusText = await _rep.ReplaceAsync(playingStatus.Status, new(client: _client));
await SetActivityAsync(statusText, (ActivityType)playingStatus.Type);
await _pubSub.Pub(_activitySetKey,
new()
{
Name = statusText,
Link = null,
Type = (ActivityType)playingStatus.Type,
Disable = false
});
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Warning(ex, "Rotating playing status errored: {ErrorMessage}", ex.Message); Log.Error(ex, "Rotating playing status errored: {ErrorMessage}", ex.Message);
} }
} }
} }