From 313336aa99641019db6d6e21b015a87c67ad8b85 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Fri, 13 Mar 2026 12:26:32 -0500 Subject: [PATCH] feat: migrate to use options monitor --- .../TextToSpeech/StreamerBotService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/GroundsForSupport.Server/TextToSpeech/StreamerBotService.cs b/src/GroundsForSupport.Server/TextToSpeech/StreamerBotService.cs index 8b6d66b..6ba6b5a 100644 --- a/src/GroundsForSupport.Server/TextToSpeech/StreamerBotService.cs +++ b/src/GroundsForSupport.Server/TextToSpeech/StreamerBotService.cs @@ -6,17 +6,17 @@ namespace GroundsForSupport.Server.TextToSpeech; internal sealed class StreamerBotService( IHttpClientFactory httpClientFactory, - IOptions options + IOptionsMonitor options ) : IStreamerBotService { private const string DoActionEndpoint = "/DoAction"; private readonly IHttpClientFactory _httpClientFactory = httpClientFactory; - private readonly StreamerBotOptions _options = options.Value; + private readonly IOptionsMonitor _options = options; public Task TriggerTextToSpeechAsync(string name, long amount, string message, CancellationToken cancellationToken = default) { var client = _httpClientFactory.CreateClient(); - var url = new UriBuilder(_options.GetBaseUrl()) + var url = new UriBuilder(_options.CurrentValue.GetBaseUrl()) { Path = DoActionEndpoint }.Uri; @@ -27,14 +27,14 @@ internal sealed class StreamerBotService( { action = new { - id = _options.TextToSpeechActionId + id = _options.CurrentValue.TextToSpeechActionId }, args = new { name, amount = $"${amount / 100.0:F2}", message, - apiKey = _options.ApiKey + apiKey = _options.CurrentValue.ApiKey } };