using HermesSocketLibrary.db; using ILogger = Serilog.ILogger; namespace HermesSocketServer.Requests { public class GetChatterIds : IRequest { public string Name => "get_chatter_ids"; public string[] RequiredKeys => []; private Database _database; private ILogger _logger; public GetChatterIds(Database database, ILogger logger) { _database = database; _logger = logger; } public async Task Grant(string sender, IDictionary? data) { IList ids = new List(); string sql = $"SELECT id FROM \"Chatter\""; await _database.Execute(sql, (IDictionary?) null, (r) => ids.Add(r.GetInt64(0))); _logger.Information($"Fetched all chatters for channel [channel: {sender}]"); return RequestResult.Successful(ids, notifyClientsOnAccount: false); } } }