Moved Requests classes to here. Added some checks to requests.

This commit is contained in:
Tom
2024-10-20 20:39:13 +00:00
parent a9cdb65895
commit e3c78d96fa
23 changed files with 186 additions and 150 deletions

View File

@@ -1,6 +1,5 @@
using System.Text.Json;
using HermesSocketLibrary.db;
using HermesSocketLibrary.Requests;
using HermesSocketLibrary.Requests.Messages;
using ILogger = Serilog.ILogger;
@@ -9,7 +8,7 @@ namespace HermesSocketServer.Requests
public class GetRedeemableActions : IRequest
{
public string Name => "get_redeemable_actions";
public string[] RequiredKeys => [];
private readonly JsonSerializerOptions _options;
private readonly Database _database;
private readonly ILogger _logger;
@@ -34,7 +33,7 @@ namespace HermesSocketServer.Requests
Data = JsonSerializer.Deserialize<IDictionary<string, string>>(r.GetString(2), _options)!
}));
_logger.Information($"Fetched all chatters' selected tts voice for channel [channel: {sender}]");
return new RequestResult(true, redemptions, notifyClientsOnAccount: false);
return RequestResult.Successful(redemptions, notifyClientsOnAccount: false);
}
}
}