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,4 @@
using System.Text.Json;
using HermesSocketLibrary.db;
using HermesSocketLibrary.Requests;
using HermesSocketLibrary.Requests.Messages;
using ILogger = Serilog.ILogger;
@@ -9,6 +7,7 @@ namespace HermesSocketServer.Requests
public class GetEmotes : IRequest
{
public string Name => "get_emotes";
public string[] RequiredKeys => [];
private Database _database;
private ILogger _logger;
@@ -28,7 +27,7 @@ namespace HermesSocketServer.Requests
Name = r.GetString(1)
}));
_logger.Information($"Fetched all emotes for channel [channel: {sender}]");
return new RequestResult(true, emotes, notifyClientsOnAccount: false);
return RequestResult.Successful(emotes, notifyClientsOnAccount: false);
}
}
}